testing.gameEngine.cameraTesting
Class CameraTest

java.lang.Object
  extended by vooga.gameEngine.game.GameRelatedObject
      extended by vooga.gameEngine.game.AbstractGame
          extended by testing.gameEngine.cameraTesting.CameraTest
All Implemented Interfaces:
java.awt.event.MouseListener, java.io.Serializable, java.util.EventListener, PauseListener

public class CameraTest
extends AbstractGame
implements java.awt.event.MouseListener

tests camera movement and mouse use arrow keys to move mouse to place and enlarge places objects;

Author:
Jacob Harer
See Also:
Serialized Form

Field Summary
(package private)  KeyMovingCameraController myCameraController
           
 
Constructor Summary
CameraTest(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 mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 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

myCameraController

KeyMovingCameraController myCameraController
Constructor Detail

CameraTest

public CameraTest(GameManager manager)
Method Detail

endGame

public boolean endGame()
Description copied from class: AbstractGame
Ends the current game. This method should be called by the instance of an AbstractGame when it is determined that the game is over.

Specified by:
endGame in class AbstractGame
Returns:
true if the game successfully ended; false otherwise

endLevel

public boolean endLevel()
Description copied from class: AbstractGame
Ends the current level. This method should be called by the instance of an 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.

Specified by:
endLevel in class AbstractGame
Returns:
true if the level was ended successfully; false otherwise

getCameraController

public CameraController getCameraController()
Description copied from class: AbstractGame
Provides access to the CameraController for this game. This method will be called by the GameManager in order to set the CameraController.

Specified by:
getCameraController in class AbstractGame
Returns:
the CameraController

quitGame

public boolean quitGame()
Description copied from class: AbstractGame
Quits the current game. Differs from 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.

Specified by:
quitGame in class AbstractGame
Returns:
true if quit was successful; false otherwise

startGame

public boolean startGame()
Description copied from class: AbstractGame
Initializes anything necessary for the game to start, and starts the game. This method will be invoked by the game engine. Thus, an instance of an AbstractGame need not call this method.

Specified by:
startGame in class AbstractGame
Returns:
true if the game successfully started; false otherwise

startLevel

public boolean startLevel()
Description copied from class: AbstractGame
Initializes anything necessary for a level to start, and starts the level. Note that this method is called by AbstractGame.loadLevel(java.util.Collection), so all GameItemss 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.

Specified by:
startLevel in class AbstractGame
Returns:
true if the level was started successfully; false otherwise

whenPaused

public void whenPaused(boolean gameLoopPaused)
Description copied from class: AbstractGame
Determines what should occur game-wise during an attempt to pause a game. Note that this method will be called by AbstractGame.pauseStatusChanged(PauseEvent).

Specified by:
whenPaused in class AbstractGame
Parameters:
gameLoopPaused - whether the game loop was successfully paused

whenResumed

public void whenResumed()
Description copied from class: AbstractGame
Defines what should occur game-wise during an attempt to resume the game. Note that this method will be called by AbstractGame.pauseStatusChanged(PauseEvent).

Specified by:
whenResumed in class AbstractGame

main

public static void main(java.lang.String[] args)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

getAllowedPlayerNumbers

public java.lang.Integer[] getAllowedPlayerNumbers()
Description copied from class: AbstractGame
Specifies what number of players are allowed in a network game. This method returns an 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.