com.jmex.game.state
Class BasicGameState

java.lang.Object
  extended by com.jmex.game.state.GameState
      extended by com.jmex.game.state.BasicGameState
Direct Known Subclasses:
CameraGameStateDefaultCamera, JMEDesktopState, StatisticsGameState, TextGameState

public class BasicGameState
extends GameState

BasicGameState should be a good foundation of any GameState really. It implements all abstract methods of GameState, and all that sets it apart is that it creates a rootNode which it update and render.

Author:
Per Thulin

Field Summary
protected  Node rootNode
          The root of this GameStates scenegraph.
 
Fields inherited from class com.jmex.game.state.GameState
active, name, parent
 
Constructor Summary
BasicGameState(java.lang.String name)
          Creates a new BasicGameState with a given name.
 
Method Summary
 void cleanup()
          Empty.
 Node getRootNode()
           
 void render(float tpf)
          Draws the rootNode.
 void update(float tpf)
          Updates the rootNode.
 
Methods inherited from class com.jmex.game.state.GameState
getName, getParent, isActive, setActive, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNode

protected Node rootNode
The root of this GameStates scenegraph.

Constructor Detail

BasicGameState

public BasicGameState(java.lang.String name)
Creates a new BasicGameState with a given name.

Parameters:
name - The name of this GameState.
Method Detail

update

public void update(float tpf)
Updates the rootNode.

Specified by:
update in class GameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.update(float)

render

public void render(float tpf)
Draws the rootNode.

Specified by:
render in class GameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.render(float)

cleanup

public void cleanup()
Empty.

Specified by:
cleanup in class GameState
See Also:
GameState.cleanup()

getRootNode

public Node getRootNode()