mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
Now there's a base state_machine script, the StateMachine is separate from the physics body. I reworked the code to follow the GDscript guidelines in the official manual.
11 lines
248 B
GDScript
11 lines
248 B
GDScript
extends "res://state_machine/state.gd"
|
|
|
|
|
|
# Initialize the state. E.g. change the animation
|
|
func enter():
|
|
owner.set_dead(true)
|
|
owner.get_node("AnimationPlayer").play("die")
|
|
|
|
func _on_animation_finished(anim_name):
|
|
emit_signal("finished", "dead")
|