Refactor player animation and collision based entrances

This commit is contained in:
2026-04-02 16:11:29 -05:00
parent eabfeab91a
commit 7ad56fb876
28 changed files with 187 additions and 118 deletions

View File

@@ -1,7 +1,7 @@
extends Node
class_name PlayerStateMachine
signal StateChanged
signal StateChanged(to_state: States, from_state: States)
enum States {
UNSET, IDLE, WALKING, USING_ITEM_A, DRAWING_BOW, FIRING_ARROW,
@@ -52,6 +52,9 @@ func _process(delta: float) -> void:
func _swap_state() -> void:
var from_state := current_state.GetStateEnum()
var to_state := queued_state
if current_state:
current_state.Exit()
@@ -60,4 +63,4 @@ func _swap_state() -> void:
queued_state = PlayerStateMachine.States.UNSET
queued_parameters = {}
StateChanged.emit()
StateChanged.emit(to_state, from_state)