Reworked idle, lookaround and death to the states

This commit is contained in:
2026-02-01 23:51:37 +03:00
parent 37b5b698a6
commit 81d81ae103
16 changed files with 153 additions and 19 deletions
@@ -0,0 +1,18 @@
extends PlayerState
const ANIMATION_DEATH = "death"
func enter() -> void:
SoundManager.play_sfx_stream(SoundManager.sfx_stream_death, player.global_position)
player.sprite.animation_finished.connect(_on_aniimation_finished, CONNECT_ONE_SHOT)
player.process_mode = Node.PROCESS_MODE_ALWAYS
process_mode = Node.PROCESS_MODE_ALWAYS
player.sprite.play(ANIMATION_DEATH)
get_tree().paused = true
func _on_aniimation_finished() -> void:
player.dead.emit()
player.queue_free()