|
||||||||||
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
games.stickfighter.StickFighterGame
public class StickFighterGame
StickFighterGame
is the main class which represents a StickFighter
game. The AI can access certain get
methods to access information
about the state of the current level being played.
Constructor Summary | |
---|---|
StickFighterGame(GameManager manager)
Creates a game given its GameManager with the default
name "Stick Fighter". |
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. |
java.util.List<LookButNoTouchCharacter> |
getCharacterInformation()
This method is used to get a list of all characters present in the current level of the game. |
void |
pauseStatusChanged(PauseEvent e)
Pauses or resumes all aspects of the game. |
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, 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 |
Constructor Detail |
---|
public StickFighterGame(GameManager manager)
GameManager
with the default
name "Stick Fighter". If manager is set to null,
an exception will be thrown, as all games must have a GameManager
.
manager
- the GameManager
managing the gameMethod Detail |
---|
public java.util.List<LookButNoTouchCharacter> getCharacterInformation()
LookButNoTouchCharacter
is returned instead of a Character
because the former can not be controlled by accessing its movement methods.
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 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 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 void pauseStatusChanged(PauseEvent e)
AbstractGame
AbstractGame.whenPaused(boolean)
or AbstractGame.whenResumed()
.
pauseStatusChanged
in interface PauseListener
pauseStatusChanged
in class AbstractGame
e
- the PauseEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |