|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.Game
vooga.engine.core.Game
public class Game
Extension of the Golden T game to automate some Vooga API functionality.
initResources() automatically loads all resources associated with the
resources.xml file in your game's resources package.
It also now has a built in GameStateManager which is automatically
initialized in initResources. The initialization behavior can be changed by
overriding initGameStates. The update and render methods call update and
render for this GameStateManager.
The game also automatically loads the initial level using the Level XML
parser
All subclasses should override initResources() and implement a main method
that calls launch(). The initResources() method should first call
super.initResources() and then initialize all the game states
Field Summary | |
---|---|
protected LevelParser |
levelParser
|
protected PlayField |
myCurrentLevel
|
protected GameState |
myPlayState
|
protected GameStateManager |
stateManager
|
Constructor Summary | |
---|---|
Game()
|
Method Summary | |
---|---|
GameState |
addGameState(GameState gameState)
add a GameState to the stateManager to prevent repetitive calls to retrieve the stateManager to add to it in Game extensions |
PlayField |
getCurrentLevel()
Returns the VoogaPlayField that is associated with the current level. |
GameStateManager |
getGameStateManager()
get the GameStateManager for this game |
GameState |
getPlayGameState()
this method gets the play game state |
protected java.lang.String |
getResourceXMLPath()
Get the path for the resources package directory where the resources.xml file is |
void |
initGameStates()
Initializes the GameStateManager. |
void |
initResources()
|
void |
initSoundPlayer()
|
static void |
launch(Game g)
Launches the game using default or given settings. |
void |
render(java.awt.Graphics2D g)
|
void |
setAsPlayGameState(GameState state)
This method sets the play game state |
void |
update(long elapsedTime)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected GameStateManager stateManager
protected LevelParser levelParser
protected PlayField myCurrentLevel
protected GameState myPlayState
Constructor Detail |
---|
public Game()
Method Detail |
---|
public void initResources()
public void update(long elapsedTime)
public void render(java.awt.Graphics2D g)
public void initSoundPlayer()
public PlayField getCurrentLevel()
public GameState getPlayGameState()
public void setAsPlayGameState(GameState state)
state
- public void initGameStates()
public GameStateManager getGameStateManager()
public GameState addGameState(GameState gameState)
gameState
- GameState to add to the Game stateManager
protected java.lang.String getResourceXMLPath()
public static void launch(Game g)
g
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |