Building a more advanced state machine in Godot 3