com.brackeen.javagamebook.state
Interface GameState


public interface GameState


Method Summary
 java.lang.String checkForStateChange()
          Returns the name of a state to change to if this state is ready to change to another state, or null otherwise.
 void draw(java.awt.Graphics2D g)
          Draws to the screen.
 java.lang.String getName()
          Gets the name of this state.
 void loadResources(ResourceManager resourceManager)
          Loads any resources for this state.
 void start(InputManager inputManager)
          Initializes this state and sets up the input manager
 void stop()
          Performs any actions needed to stop this state.
 void update(long elapsedTime)
          Updates world, handles input.
 

Method Detail

getName

java.lang.String getName()
Gets the name of this state. Used for the checkForStateChange() method.


checkForStateChange

java.lang.String checkForStateChange()
Returns the name of a state to change to if this state is ready to change to another state, or null otherwise.


loadResources

void loadResources(ResourceManager resourceManager)
Loads any resources for this state. This method is called in a background thread before any GameStates are set.


start

void start(InputManager inputManager)
Initializes this state and sets up the input manager


stop

void stop()
Performs any actions needed to stop this state.


update

void update(long elapsedTime)
Updates world, handles input.


draw

void draw(java.awt.Graphics2D g)
Draws to the screen.