> This article describe a simple mobile game:
> http://www.javaworld.com/javaworld/jw-08-2004/jw-0809-j2me.html
[quoted text clipped - 7 lines]
> But I'm not sure this is the correct way of doing it, so I would like to
> know how you would have done this?
Almost every game I build is based around a hierarchical state machine.
A in-game menu is just another state that gets pushed onto a stack of
states. When in this state, the game world does not get updated (so a
monster can't kill you while you are adjusting your sound volume, for
example), and when the user is done, the state just gets popped off the
stack, and the user is right back exactly where she was in the game. With
this system, the game can be paused and the option menu accessed at any
moment; even during cutscenes or the loading screens, for example.
- Oliver