jmetest.game.state
Class TestGameStateSystem

java.lang.Object
  extended bycom.jme.app.AbstractGame
      extended bycom.jme.app.BaseGame
          extended byjmetest.game.state.TestGameStateSystem

public class TestGameStateSystem
extends BaseGame

This test shows how to use the game state system. It can not extend SimpleGame because a lot of SimpleGames functions (e.g. camera and input) has been delegated down to the individual game states. So this class is basically a stripped down version of SimpleGame which inits the GameStateManager.

Author:
Per Thulin

Field Summary
protected  Node rootNode
           
protected  Timer timer
           
protected  float tpf
           
 
Fields inherited from class com.jme.app.AbstractGame
ALWAYS_SHOW_PROPS_DIALOG, display, finished, FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG, NEVER_SHOW_PROPS_DIALOG, properties
 
Constructor Summary
TestGameStateSystem()
           
 
Method Summary
protected  void cleanup()
          Cleans up the keyboard.
protected  void initGame()
          Called in BaseGame.start() after initSystem().
protected  void initSystem()
          Creates display, sets up camera, and binds keys.
static void main(java.lang.String[] args)
           
protected  void reinit()
          unused
protected  void render(float interpolation)
          This is called every frame in BaseGame.start(), after update()
protected  void update(float interpolation)
          This is called every frame in BaseGame.start()
 
Methods inherited from class com.jme.app.BaseGame
quit, start
 
Methods inherited from class com.jme.app.AbstractGame
assertDisplayCreated, finish, getAttributes, getVersion, setDialogBehaviour, setDialogBehaviour, setDialogBehaviour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNode

protected Node rootNode

timer

protected Timer timer

tpf

protected float tpf
Constructor Detail

TestGameStateSystem

public TestGameStateSystem()
Method Detail

update

protected final void update(float interpolation)
This is called every frame in BaseGame.start()

Specified by:
update in class BaseGame
Parameters:
interpolation - unused in this implementation
See Also:
AbstractGame#update(float interpolation)

render

protected final void render(float interpolation)
This is called every frame in BaseGame.start(), after update()

Specified by:
render in class BaseGame
Parameters:
interpolation - unused in this implementation
See Also:
AbstractGame#render(float interpolation)

initSystem

protected final void initSystem()
Creates display, sets up camera, and binds keys. Called in BaseGame.start() directly after the dialog box.

Specified by:
initSystem in class BaseGame
See Also:
AbstractGame#initSystem()

initGame

protected final void initGame()
Called in BaseGame.start() after initSystem().

Specified by:
initGame in class BaseGame
See Also:
AbstractGame#initGame()

reinit

protected void reinit()
unused

Specified by:
reinit in class BaseGame
See Also:
AbstractGame#reinit()

cleanup

protected void cleanup()
Cleans up the keyboard.

Specified by:
cleanup in class BaseGame
See Also:
AbstractGame#cleanup()

main

public static void main(java.lang.String[] args)
Parameters:
args -