diff options
| author | iamcheeseman <[hidden email]> | 2026-02-14 18:02:47 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-02-14 18:02:47 -0500 |
| commit | 93c27830060788dea1c364465d29e44d05a3064e (patch) | |
| tree | 4a8e1f6628026a4fb82c8a1c6084f2e35750cc28 /src/player.odin | |
| parent | 1ff729f696c895f81f0cf0d1b8a2cca1d6e43eb8 (diff) | |
Only process keys that are bound to an action
Diffstat (limited to 'src/player.odin')
| -rw-r--r-- | src/player.odin | 5 |
1 files changed, 3 insertions, 2 deletions
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) |
