Implementing the Command pattern in Godot
In this section, we will put the Command pattern into practice by paving the way for an AI system that takes the Bumping Pig enemy actions and turns them into commands that we can map to an interface. This all boils down to our game designer’s request, as they want to quickly test new behaviors for the Bumping Pig enemy and would like to put them into context instead of creating fake testing scenes.
Let’s see what they want so we understand their issues and goals and help them:
“Hey there, it’s me again, the game designer.
You did an excellent job with that state thing. Having the Bumping Pig delegate all its actions to the states really helped me have more control over what is possible in each state. Though, there’s a lot of duplicate code now. But I think it paid off.
I also managed to understand how to use the AnimationTree’s state machine! I managed to make one new animation node. I...