If you read my post last week, you’ll know I was rather excited about the fact that my NPCs were pretty much all working, and life was wonderful. Except as I’m...
That's actually very handy... for instance, an "Active" state for the player lets the user move, jump, run, use his power ups... then when you receive damage you change the state to "Damage" and you may inactivate the controls and throw the player a couple of pixels away like receiving an impact, then return to "Active" and enable movement again. And for special powers they may be "sub-states" of the main "Active" state. Is usefull also for handling animations with more complex effects. When I did this I first used instance variables for my objects, and months later I was able to develop a behavior and a plugin for handling the whole game state and each object's state.