|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.game.AbstractGame
testing.gameEngine.WormsDemo.WormsDemo
public class WormsDemo
Field Summary | |
---|---|
(package private) WormsCameraController |
myCameraController
|
static java.util.ResourceBundle |
RESOURCES
|
Constructor Summary | |
---|---|
WormsDemo(GameManager manager)
|
Method Summary | |
---|---|
boolean |
endGame()
Ends the current game. |
boolean |
endLevel()
Ends the current level. |
java.lang.Integer[] |
getAllowedPlayerNumbers()
Specifies what number of players are allowed in a network game. |
CameraController |
getCameraController()
Provides access to the CameraController for this game. |
static void |
main(java.lang.String[] args)
|
void |
processAddRequest(AddGameObjectEvent e)
Optionally checks whether it is okay to add the item requesting addition to the game and then adds that item to the game. |
void |
processRemoveRequest(RemoveGameObjectEvent e)
Removes the source object of the RemoveGameObjectEvent
parameter or checks to see if this remove is possible before taking
action. |
boolean |
quitGame()
Quits the current game. |
boolean |
startGame()
Initializes anything necessary for the game to start, and starts the game. |
boolean |
startLevel()
Initializes anything necessary for a level to start, and starts the level. |
void |
whenPaused(boolean gameLoopPaused)
Determines what should occur game-wise during an attempt to pause a game. |
void |
whenResumed()
Defines what should occur game-wise during an attempt to resume the game. |
Methods inherited from class vooga.gameEngine.game.AbstractGame |
---|
getManager, loadLevel, loadLevel, pauseStatusChanged, removeAllKeyInputs, removeAllKeyInputs, removeKeyInput, restartLevel, setKeyInput, setKeyInput, setMouseInput |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
WormsCameraController myCameraController
public static final java.util.ResourceBundle RESOURCES
Constructor Detail |
---|
public WormsDemo(GameManager manager)
Method Detail |
---|
public boolean endGame()
AbstractGame
AbstractGame
when it is determined that the game is over.
endGame
in class AbstractGame
public boolean endLevel()
AbstractGame
AbstractGame
when it is determined that the current level
is over. Note: There is a EndLevelListener
-EndLevelEvent
pair provided for convenience. If used, the
endLevelRequested
method of the
EndLevelListener
should contain a call to this method.
endLevel
in class AbstractGame
public CameraController getCameraController()
AbstractGame
CameraController
for this game. This
method will be called by the GameManager
in order to set the
CameraController
.
getCameraController
in class AbstractGame
CameraController
public boolean quitGame()
AbstractGame
AbstractGame.endGame()
in that this method
would be called if the user attempts to quit in the middle of a game.
This method should be called by the instance of an
AbstractGame
when it is determined that a quit is desired.
quitGame
in class AbstractGame
public boolean startGame()
AbstractGame
AbstractGame
need not call this method.
startGame
in class AbstractGame
public boolean startLevel()
AbstractGame
AbstractGame.loadLevel(java.util.Collection extends java.lang.Object>)
, so all
GameItems
s have already been loaded. Note: There is a
StartLevelListener
-StartLevelEvent
pair provided for
convenience. If used, the startLevelRequested
method of the
StartLevelListener
should contain a call to this method.
Moreover, if one has a collection of items that define a particular level
or a file that contains such items, this method can call
AbstractGame.loadLevel(Collection)
or AbstractGame.loadLevel(File)
rather than
adding them to the manager directly.
startLevel
in class AbstractGame
public void whenPaused(boolean gameLoopPaused)
AbstractGame
AbstractGame.pauseStatusChanged(PauseEvent)
.
whenPaused
in class AbstractGame
gameLoopPaused
- whether the game loop was successfully pausedpublic void whenResumed()
AbstractGame
AbstractGame.pauseStatusChanged(PauseEvent)
.
whenResumed
in class AbstractGame
public static void main(java.lang.String[] args)
public java.lang.Integer[] getAllowedPlayerNumbers()
AbstractGame
Array
of
Integers specifying which numbers
of players are allowed during network play. Thus a game which supports 2 and 4 players
but not 3 should return an array {2,4}. It is unlikely that a network game would ever allow
a single player and thus should not return {1,...}. Games which are not networked need not implement this method.
- Specified by:
getAllowedPlayerNumbers
in class AbstractGame
- Returns:
- An array specifying all allowed numbers of players for a
networked instance of a game.
public void processAddRequest(AddGameObjectEvent e)
AddRemoveGameObjectListener
processAddRequest
in interface AddRemoveGameObjectListener
e
- The event which holds a GameItem
requesting to be
added to the game.public void processRemoveRequest(RemoveGameObjectEvent e)
AddRemoveGameObjectListener
RemoveGameObjectEvent
parameter or checks to see if this remove is possible before taking
action.
processRemoveRequest
in interface AddRemoveGameObjectListener
e
- The event whose source is the Object
desiring
removal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |