being very new to j2me game development there is a question which im very interested in:
i read a few source codes where the separation of the game logic (e.g. Menu -> game -> highscore -> setting etc) is solved over large state machines and masses of constants.
so for every repaint a switch-tree decides which of the 20 states to choose (i even saw scripted tutorials working over very much of those states).
i know that most people do this for performance reasons, to save resources avoiding lots of meta-classes and interfaces.
but im really wondering if it wouldnt be better in performance (and without doubt in readability) to use a flat hierarchy for the main states, like in desktop games:
an actualGameState object which carries the menu, or the game and so on. this would save lots of teh state comparisons …
some opinions of more experienced mobild programmers ?