The ideal jMonkeyEngine application has an empty simpleUpdate()
method in its main class—all entity behavior would be neatly modularized and encapsulated in controls and AppState
objects.
The ideal jMonkeyEngine application's
simpleInitApp()
method would have only two lines of code: one that creates a custom StartScreenAppState
instance, and a second line that attaches it to the stateManager
object of the SimpleApplication
class. Let's look at one simple example of how you can structure your application using several modular AppState
objects:
The
StartScreenAppState
tab would display a main menu with buttons, such as play, options, and quit. It has a visible mouse pointer and itsinputManager
object responds to clicks on buttons.When the user clicks on the options button, the
StartScreenAppState
method attaches anOptionsScreenAppState
object and detaches itself.The
OptionsScreenAppState
object displays user preferences and offers a user interface to customize...