vooga.games.mariogame.states
Class GamePlayState
java.lang.Object
vooga.engine.state.GameState
vooga.games.mariogame.states.GamePlayState
public class GamePlayState
- extends GameState
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 |
myLevels
public java.util.Collection<PlayField> myLevels
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 windowheight
- is the desired height of the game window
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()