erland.game.tileadventure
Class TileAdventurePlayer

java.lang.Object
  extended by erland.game.tileadventure.TileAdventurePlayer
All Implemented Interfaces:
GamePlayerInterface, ControllerInterface

public class TileAdventurePlayer
extends Object
implements GamePlayerInterface, ControllerInterface

Implementation of control of the user player


Constructor Summary
TileAdventurePlayer(GameEnvironmentInterface environment, int playerNo)
          Create player object
 
Method Summary
 ActionHandlerInterface getActionHandler()
           
 NetworkConnectionInterface getConnection()
           
 GameObject getControlledObject()
           
 GameObject getPlayerObject()
           
 boolean isCompleted()
          Check if player has completed game
 boolean isGameOver()
          Check if game is over for player
 void jump()
          Jump
 void setActionHandler(ActionHandlerInterface actionHandler)
           
 void setConnection(NetworkConnectionInterface connection)
           
 void setPlayerObject(GameObject object)
           
 void startMoveDown()
          Start moving down
 void startMoveLeft()
          Start moving left
 void startMoveRight()
          Start moving right
 void startMoveUp()
          Start moving up
 void stopMoveDown()
          Stop moving down
 void stopMoveLeft()
          Stop moving left
 void stopMoveRight()
          Stop moving right
 void stopMoveUp()
          Stop moving up
 void stopped(ActionInterface action)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileAdventurePlayer

public TileAdventurePlayer(GameEnvironmentInterface environment,
                           int playerNo)
Create player object

Parameters:
environment - Game environment
playerNo - Player number (if networked game)
Method Detail

setConnection

public void setConnection(NetworkConnectionInterface connection)
Specified by:
setConnection in interface GamePlayerInterface

getConnection

public NetworkConnectionInterface getConnection()
Specified by:
getConnection in interface GamePlayerInterface

setPlayerObject

public void setPlayerObject(GameObject object)

getPlayerObject

public GameObject getPlayerObject()

getActionHandler

public ActionHandlerInterface getActionHandler()

setActionHandler

public void setActionHandler(ActionHandlerInterface actionHandler)

startMoveRight

public void startMoveRight()
Start moving right


startMoveLeft

public void startMoveLeft()
Start moving left


startMoveUp

public void startMoveUp()
Start moving up


startMoveDown

public void startMoveDown()
Start moving down


stopMoveRight

public void stopMoveRight()
Stop moving right


stopMoveLeft

public void stopMoveLeft()
Stop moving left


stopMoveUp

public void stopMoveUp()
Stop moving up


stopMoveDown

public void stopMoveDown()
Stop moving down


jump

public void jump()
Jump


update

public void update()

isCompleted

public boolean isCompleted()
Check if player has completed game

Returns:
true if game is completed

isGameOver

public boolean isGameOver()
Check if game is over for player

Returns:
true if game is over for player

getControlledObject

public GameObject getControlledObject()
Specified by:
getControlledObject in interface ControllerInterface

stopped

public void stopped(ActionInterface action)
Specified by:
stopped in interface ControllerInterface


Copyright © 2003-2006 Erland Isaksson. All Rights Reserved.