Finite state machine in C++

Posted by Electro on Game Development See other posts from Game Development or by Electro
Published on 2010-11-27T21:57:12Z Indexed on 2011/02/19 15:33 UTC
Read the original article Hit count: 400

Filed under:
|
|
|
|

So, I've read a lot about using FSMs to do game state management, things like what and FSM is, and using a stack or set of states for building one. I've gone through all that. But I'm stuck at writing an actual, well-designed implementation of an FSM for that purpose. Specifically, how does one cleanly resolve the problem of transitioning between states, (how) should a state be able to use data from other states, and so on. Does anyone have any tips on designing and writing a implementation in C++, or better yet, code examples?

© Game Development or respective owner

Related posts about c++

Related posts about programming