[Tutorial] Hierarchical Finite State Machine

Hi everyone,

I would like to share with you a simple Hierarchical Finite State Machine that i’ve built for my game. This one is based on Apple GameplayKit State Machine. It is easy to use and manage multiple states either for character animations or general gameplay states.

Here is the link:

5 Likes

Thank you. I used it (modified slightly), to create a sprite animator for my game!

Thanks! this is really useful.

@milos1290 hey, I was wondering if you have any more useful modules that you could share? :slight_smile:

hi, @milos1290 @bilalmirza @NikosKK @slackmoehrle @kds thanks for this concept, we want to apply this in our game and so we have downloaded these files and made some changes, but the problem is new State is not adding in the parent node, I meant we have taken the state as Layer(inheritance) And adding it into parent class, but nothing showing off whatever is in state AppDelegate.cpp (6.0 KB) AppDelegate.h (2.2 KB) example.h (4.1 KB) HelloWorldScene.cpp (5.0 KB) HelloWorldScene.h (5.4 KB) state.h (1.4 KB)

these are the file we have modified