A simple implementation of a variation on a finite state machine that uses a 'pushdown' stack arrangement to handle states.
Attach an instance of the finite_stack_machine.gd class to any entity in your Godot scene. Push new states to the top or bottom of your 'state stack' to control the flow of behavior.
The demo shows of some of the features. I've only done limited testing on the on_start and on_end transitions of states, but so far everything seems to be working. Please make an issue if something isn't working!
Still in an early version with some planned features missing: better input event handling, perhaps hierarchical states, etc.