|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.state.GameState
vooga.games.mariogame.GamePlayState
public class GamePlayState
Nested Class Summary | |
---|---|
static class |
GamePlayState.State
|
Field Summary |
---|
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 |
getCurrentLevel()
|
int |
getScore()
|
void |
init()
This method initializes all necessary variables, such as playfields, backgrounds, enemies, and tiles for the start of the game. |
GamePlayState.State |
nextState()
This method is called in the MarioClone update method in order to check if any state transitions need to happen. |
void |
render(java.awt.Graphics2D g)
Main render method that renders the backgrounds and playfield. |
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, initialize, isActive, removeEverything |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GamePlayState(Game game)
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 windowMethod Detail |
---|
public GamePlayState.State nextState()
public void update(long t)
update
in class GameState
t
- - the time constant that the engine uses for updating.public void init()
public int getScore()
public void render(java.awt.Graphics2D g)
render
in class GameState
public int getCurrentLevel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |