Finite state machine (State&Command patterns implementation) in GDScript with separate classes representing actions
Includes three abstract classes: StateMachine, State, Action
Adding a new character mechanic is as simple as:
- dropping an
Action
child-node in aState
node in aStateMachine
node - overriding
_update(delta)
or_handle_input(event)
Character
--StateMachine
----State1
------Action1
------Action2
----State2
------Action1
------Action3