This commit is contained in:
2026-03-14 12:58:55 -05:00
parent 6738e8d217
commit 1c95315496
22 changed files with 313 additions and 45 deletions

View File

@@ -1,9 +1,11 @@
extends Node
class_name PlayerStateMachine
signal StateChanged
enum States {
UNSET, IDLE, WALKING, USING_ITEM_A, DRAWING_BOW, FIRING_ARROW,
SITTING, CUTSCENE
SITTING, CUTSCENE, PLAY_ANIMATION
}
@export var states_container: Node
@@ -36,7 +38,6 @@ func _ready() -> void:
current_state.Enter({})
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if current_state:
current_state.Update(delta)
@@ -53,3 +54,5 @@ func _swap_state() -> void:
current_state.Enter(queued_parameters)
queued_state = PlayerStateMachine.States.UNSET
queued_parameters = {}
StateChanged.emit()