diff options
Diffstat (limited to 'src/player.odin')
| -rw-r--r-- | src/player.odin | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/player.odin b/src/player.odin index 4e1fe90..061726f 100644 --- a/src/player.odin +++ b/src/player.odin @@ -180,6 +180,7 @@ _default_state :: proc(dt: f32) { pos = bullet_pos, vel = mouse_dir * 800, lifetime = 0.25, + mask = {.Hard, .Enemy}, ) } @@ -480,40 +481,6 @@ player_take_damage :: proc(#any_int amt: i16, kb_dir: Vec2) { phys.set_velocity(player.body, vel) } -draw_player_fg :: proc() { - rc_start := phys.get_position(player.body) - dir := Vec2{math.cos(player.gun.sprite.rotation), math.sin(player.gun.sprite.rotation)} - rc_end := rc_start + dir * 32 - collision, is_colliding := phys.get_closest_raycast_collision( - phys.make_raycast(rc_start, rc_end), - ) - - if is_colliding { - rect := phys.get_rect(collision.body) - fw.draw_rect(rect.start, rect.size, color = Color{0, 1, 1, 0.5}) - fw.draw_line(rc_start, rc_end, color = fw.GREEN) - fw.draw_rect(collision.enter, {1, 1}, color = fw.RED) - fw.draw_rect(collision.exit, {1, 1}, color = fw.BLUE) - } - - input := _get_input_dir() - pos := phys.get_position(player.body) - rect := phys.get_rect(player.body) - rect.start += pos - - top_start := rect.start + {rect.size.x * 0.5, 0} - top_end := top_start + {input * 8, 0} - - bot_start := rect.start + {rect.size.x * 0.5, rect.size.y} - bot_end := bot_start + {input * 8, 0} - - fw.draw_line(top_start, top_end) - fw.draw_line(bot_start, bot_end) - - // top_rc := phys.make_raycast(top_start, top_end) - // bot_rc := phys.make_raycast(bot_start, bot_end) -} - @(private = "file") already_spawned_player := false |
