vooga.games.mariogame.states
Class GamePlayState

java.lang.Object
  extended by vooga.engine.state.GameState
      extended by vooga.games.mariogame.states.GamePlayState

public class GamePlayState
extends GameState


Nested Class Summary
static class GamePlayState.State
           
 
Field Summary
 java.util.Collection<PlayField> myLevels
           
 
Fields inherited from class vooga.engine.state.GameState
myRenderField, myUpdateField
 
Constructor Summary
GamePlayState(Game game)
          This constructs a GamePlayState by initializing the player as well as the game dimensions.
 
Method Summary
 int getScore()
           
 void initEvents()
           
 void initialize()
          The initialize method sets up specific variables and parameters necessary to the specific functioning of the GameState.
 void initLevel()
          This method initializes all necessary variables, such as playfields, backgrounds, enemies, and tiles for the start of the game.
 void initOverlays()
           
 void nextLevel()
           
 void render(java.awt.Graphics2D g)
          Main render method that renders the backgrounds and playfield.
 void restart()
           
 void scrollLevel()
           
 void update(long t)
          This method is responsible for updating the main game playfield, which contains all of the game sprites.
 
Methods inherited from class vooga.engine.state.GameState
activate, addGroup, addPlayField, addRenderPlayField, addRenderState, addState, addUpdatePlayField, addUpdateState, deactivate, equals, getGroup, getRenderField, getUpdateField, isActive, removeEverything
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myLevels

public java.util.Collection<PlayField> myLevels
Constructor Detail

GamePlayState

public GamePlayState(Game game)
This constructs a GamePlayState by initializing the player as well as the game dimensions.

Parameters:
mario - is a MarioSprite, which represents the user controlled sprite.
width - is the desired width of the game window
height - is the desired height of the game window
Method Detail

update

public void update(long t)
This method is responsible for updating the main game playfield, which contains all of the game sprites.

Overrides:
update in class GameState
Parameters:
t - - the time constant that the engine uses for updating.

nextLevel

public void nextLevel()

initLevel

public void initLevel()
This method initializes all necessary variables, such as playfields, backgrounds, enemies, and tiles for the start of the game.


initEvents

public void initEvents()

initOverlays

public void initOverlays()

getScore

public int getScore()

render

public void render(java.awt.Graphics2D g)
Main render method that renders the backgrounds and playfield.

Overrides:
render in class GameState

scrollLevel

public void scrollLevel()

initialize

public void initialize()
Description copied from class: GameState
The initialize method sets up specific variables and parameters necessary to the specific functioning of the GameState. This should include all of the necessary initialization for the GameState's specific use, rather than anything broadly required for all GameStates.

Specified by:
initialize in class GameState

restart

public void restart()