From 93c27830060788dea1c364465d29e44d05a3064e Mon Sep 17 00:00:00 2001 From: iamcheeseman <[hidden email]> Date: Sat, 14 Feb 2026 18:02:47 -0500 Subject: Only process keys that are bound to an action --- src/player.odin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/player.odin') diff --git a/src/player.odin b/src/player.odin index 135bcf6..2f82e2f 100644 --- a/src/player.odin +++ b/src/player.odin @@ -123,8 +123,7 @@ _default_state :: proc(dt: f32) { rel_mouse_pos := fw.get_mouse_pos() - pos - // if fw.is_keybind_just_down(actions.shoot) { - if fw.is_keybind_down(actions.shoot) { + if fw.is_keybind_just_down(actions.shoot) { mouse_dir := linalg.normalize0(rel_mouse_pos + {0, PLAYER_GUN_HEIGHT}) bullet_pos := pos @@ -309,7 +308,9 @@ draw_player :: proc() { if player.state != .Dash { draw_sprite(player.gun.sprite) } +} +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)} bodies := phys.get_colliding_bodies(phys.make_raycast(rc_start, dir), allocator = context.temp_allocator) -- cgit v1.3-2-g0d8e