mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-07 16:30:06 +01:00
* Add player_state dictionary to manage player state names for FSM demo * Use a constant typed Dictionary of StringNames and update to Godot 4.5 --------- Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
11 lines
287 B
GDScript
11 lines
287 B
GDScript
extends "res://player/player_state.gd"
|
|
|
|
# Initialize the state. E.g. change the animation.
|
|
func enter() -> void:
|
|
owner.set_dead(true)
|
|
owner.get_node(^"AnimationPlayer").play(PLAYER_STATE.die)
|
|
|
|
|
|
func _on_animation_finished(_anim_name: String) -> void:
|
|
finished.emit(PLAYER_STATE.dead)
|