<Application (AbstractGame and subclasses)|User's Guide|SimpleGame>
BaseGame provides a very raw, non-complex game loop an. The loop is a pure high speed loop, each iteration is processing as fast as the CPU/GPU can handle it. A lot of implementation is left up to the user.
initSystem() - This is the first thing that the game loop thread calls. Upon returning from this method the display system must be initialized or a JmeException will be thrown.
initGame() - This is called after initSystem() returns. This is where the scene graph should be set up and the game initialized.
update(float) - Update is called with a value of -1.0f. The value of the float is meaningless since the game loop runs as fast as the cpu and graphics hardware will allow.
render(float) - Render is called with a value of -1.0f. The value of the float is meaningless since the game loop runs as fast as the cpu adn graphics hardware will allow.
Thread.yield() - It should be noted that at the end of each game loop, the game will yield to any other executing processes to keep from hogging the system.
If the game is not ending, loop to step 3 - calling finish() on the game will cause the game loop to quit looping
cleanup() - This will be called when the game loop is terminating. Cleanup should be performed here.
quit() - This will be called right before the main loop terminates. The application should exit after this is call as long as no other non-daemon threads are still running
The game loop is contained in the start method. Therefore, a call to start() does not return until the game loop terminates. Also, remember that there is no timing in BaseGame! It runs as fast as the computer allows with not timer to keep track of the duration of each frame. This can lead to erratic behavior if you rely on a consistent frame rate.
The reinit method is what is called when the system requires rebuilding. Such times as when the display settings change (resolution change for instance), will require a call to the reinit method to rebuild the display settings. This must be implemented property if you need to change resolutions or other display settings mid-game.
The javadoc contains additional information: Javadoc.
<Application (AbstractGame and subclasses)|User's Guide|SimpleGame>