From d57194597e988c82446d9c2a3ddeb6b08c0b4fad Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Sun, 22 Jan 2023 13:59:48 -0500 Subject: [PATCH] fix INACTIVE state in player --- objects/player/player.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/objects/player/player.gd b/objects/player/player.gd index ed1d2b7..f72b0b9 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -38,12 +38,12 @@ func _ready(): Game.respawn_point = global_position func _physics_process(delta): + if current_state == State.INACTIVE: + return axis = Vector2(Input.get_axis("ui_left","ui_right"),Input.get_axis("ui_up","ui_down")) #Check ladder check_ladder() match current_state: - State.INACTIVE: - return State.IDLE: _process_idle() continue @@ -270,6 +270,8 @@ func check_ladder(): #climb_ray.position.x = 4 * sprite.scale.x func die(): + if current_state == State.INACTIVE: + return var new_particles = death_particles.duplicate() get_parent().add_child(new_particles) new_particles.global_position = global_position @@ -296,6 +298,8 @@ func die(): sprite.visible = true func _on_AnimationPlayer_animation_finished(anim_name): + if current_state == State.INACTIVE: + return #Return to idle after slash if anim_name == "stab": current_state = State.IDLE