I started by building a StateMachine following GDQuest's example, but I didn't like that the State nodes were tightly coupling to their grandparent, and I discovered that what I really wanted was for every state transition to emit a signal I could respond to in the script of the node whose state I'm dealing with. I also added an InputLayer resource to store configuration binding actions to functions for each state. Now I am able to define all of Game's scene switching behavior inside of Game. Here is a toy example of what the interface looks like:
#[WIP] SignalMachine (fsm implementation)
2 messages · Page 1 of 1 (latest)