So based on all the great feedback I have implemented 2 types of states. non-exclusive and exclusive. All the non-exclusive states can happen at the same time or not at all it doesn’t matter. For the exclusive states I am starting with these:
Normal
Super - can eat anything
Crazy - acts erratically
Ghost - others can not see him
Sick - slow and weak
Frozen - Everything on the screen is frozen but him.
there is also dead, spawning etc…
So my state diagram looks like this:
So as I move around I notice that if I am super and eat something that should make me super again it does nothing because I only transition from the normal state. Same goes for sick. If he is sick and manages to eat something that should make him super I would like that to happen. So in my simple example I realize what I really want is something like this:
I believe I can handle all this with if statements but suggestions are welcome.
L