diff --git a/scenes/player/states/player_walking.gd b/scenes/player/states/player_walking.gd index 050af35..e534066 100644 --- a/scenes/player/states/player_walking.gd +++ b/scenes/player/states/player_walking.gd @@ -7,15 +7,19 @@ func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void: func _state_physics_update(_delta: float) -> void: +#region player physics var direction: Vector2 = player.get_movement_vector() direction = direction.normalized() player.velocity = direction * player.max_speed player.move_and_slide() +#endregion if watch_state([WALKING]): return +#region player animation if direction.y > 0: player.sprite.play("walk_down") elif direction.y < 0: player.sprite.play("walk_up") elif direction.x > 0: player.sprite.play("walk_right") elif direction.x < 0: player.sprite.play("walk_left") +#endregion