From 30a49954e4cb434a1c47503c839feb20558a202b Mon Sep 17 00:00:00 2001 From: iamcheeseman <[hidden email]> Date: Fri, 16 Jan 2026 14:08:51 -0500 Subject: Rename enums to use Ada_Case --- src/player.odin | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/player.odin') diff --git a/src/player.odin b/src/player.odin index 7483bab..9cec035 100644 --- a/src/player.odin +++ b/src/player.odin @@ -27,8 +27,8 @@ PLAYER_GUN_KICKBACK :: 4 // how far to move the gun back when you shoot PLAYER_SCARF_DIST :: 5 Player_State :: enum { - DEFAULT, - DASH, + Default, + Dash, } // there will only ever be one player, so just make it a global :) @@ -55,19 +55,19 @@ player: struct { init_player :: proc() { body := phys.make_body( phys.Rect{{-4, -8}, {8, 16}}, - layers = {.PLAYER}, - mask = {.DEFAULT} + layers = {.Player}, + mask = {.Default} ) player.body = body - init_sprite(&player.sprite, .PLAYER) + init_sprite(&player.sprite, .Player) player.sprite.offset = Vec2 { math.floor(f32(player.sprite.width / 2)), math.floor(f32(player.sprite.height / 2)), } - init_sprite(&player.gun.sprite, .PISTOL) + init_sprite(&player.gun.sprite, .Pistol) player.gun.sprite.offset = Vec2 { -PLAYER_GUN_DIST, @@ -130,7 +130,7 @@ _default_state :: proc(dt: f32) { vel := phys.get_velocity(player.body) collisions := phys.get_collisions(player.body) - if .DOWN in collisions { + if .Down in collisions { player.coyote_time = PLAYER_COYOTE_TIME player.has_double_jumped = false } else { @@ -178,7 +178,7 @@ _default_state :: proc(dt: f32) { } } - if .DOWN not_in collisions && + if .Down not_in collisions && !is_keybind_down(actions.jump) && vel.y < PLAYER_JUMP_RELEASE_CUT { vel.y = PLAYER_JUMP_RELEASE_CUT @@ -209,7 +209,7 @@ _enter_dash :: proc() { ) player.dash_timer = PLAYER_DASH_TIME - player.state = .DASH + player.state = .Dash } @(private = "file") @@ -225,7 +225,7 @@ _dash_state :: proc(dt: f32) { @(private = "file") _exit_dash :: proc() { - player.state = .DEFAULT + player.state = .Default player.dash_cooldown = PLAYER_DASH_COOLDOWN @@ -286,8 +286,8 @@ _change_rooms :: proc() { update_player :: proc(dt: f32) { switch player.state { - case .DEFAULT: _default_state(dt) - case .DASH: _dash_state(dt) + case .Default: _default_state(dt) + case .Dash: _dash_state(dt) } pos := phys.get_position(player.body) @@ -329,7 +329,7 @@ update_player :: proc(dt: f32) { draw_player :: proc() { draw_tail(player.scarf) draw_sprite(player.sprite) - if player.state != .DASH { + if player.state != .Dash { draw_sprite(player.gun.sprite) } } -- cgit v1.3-2-g0d8e