vooga.games.tronupdate.items
Class TronPlayer

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by vooga.engine.core.BetterSprite
          extended by vooga.games.tronupdate.items.TronPlayer

public class TronPlayer
extends BetterSprite


Field Summary
 GridSpace grid
           
 
Constructor Summary
TronPlayer(java.awt.image.BufferedImage image, int initialColPosition, int initialRowPosition, int playerImageWidth, Direction dir)
           
TronPlayer(java.awt.image.BufferedImage image, int initialColPosition, int initialRowPosition, int playerImageWidth, java.lang.String initialDirection)
          constructor
 
Method Summary
 void changePlayerColumn(int amount)
           
 void changePlayerRow(int amount)
           
 void down()
          handles down turning
 void fillBlock(int row, int col)
          mark the block if it is filled by items in the game
 Direction getDirection()
          get the direction the player is heading
 int getImageWidth()
          get the width of the image
 double getPlayerColumn()
          get the column position for the player
 double getPlayerRow()
          get the row position of the player
 double getPlayerXPosition()
          get the X-coordinate position for the player
 double getPlayerYPosition()
          get the Y-coordinate position of the player
 boolean isAI()
           
 void left()
          handles left turning
 boolean playerInbound()
          check to see if players are in bound
 double playerXDirectionMove()
          routinely update the X-coordinate for the player (keep going in the same X-direction)
 double playerYDirectionMove()
          routinely update the Y-coordinate for the player (keep going in the same Y-direction)
 void resetPosition()
           
 void right()
          handles right turning
 void setAsAI(boolean flag)
           
 void setDirection(Direction dir)
          set the direction the player is heading
 void setPlayerRowandCol(int currentRow, int currentColumn)
          set the row and column position for the player
 void setSpeedUp(int rate)
          speed up the speed
 void up()
          handles up turning
 void update(long elapsedTime)
          Specify how the GameEntity Object should be updated.
 double updatePlayerXPosition(Direction playerDirection)
          update the X-coordinate position of the player
 double updatePlayerYPosition(Direction playerDirection)
          update the Y-coordinate position for the player
 
Methods inherited from class vooga.engine.core.BetterSprite
addAnimatedImages, addHorizontalSpeed, addImage, addSprite, addVerticalSpeed, firstRun, forceX, forceY, getCurrentSprite, getDistance, getDoubleStat, getHeight, getHorizontalSpeed, getImage, getIntStat, getStat, getTimeInExistence, getVerticalSpeed, getWidth, getX, getY, isActive, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setAsRenderedSprite, setBackground, setDoubleStat, setHorizontalSpeed, setImage, setImages, setIntStat, setLayer, setLocation, setMovement, setSpeed, setStat, setVerticalSpeed, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

public GridSpace grid
Constructor Detail

TronPlayer

public TronPlayer(java.awt.image.BufferedImage image,
                  int initialColPosition,
                  int initialRowPosition,
                  int playerImageWidth,
                  java.lang.String initialDirection)
constructor

Parameters:
image -
initialColPosition -
initialRowPosition -
gridSpace -
playerImageWidth -
initialDirection -

TronPlayer

public TronPlayer(java.awt.image.BufferedImage image,
                  int initialColPosition,
                  int initialRowPosition,
                  int playerImageWidth,
                  Direction dir)
Method Detail

resetPosition

public void resetPosition()

setAsAI

public void setAsAI(boolean flag)

isAI

public boolean isAI()

fillBlock

public void fillBlock(int row,
                      int col)
mark the block if it is filled by items in the game

Parameters:
row -
col -

getImageWidth

public int getImageWidth()
get the width of the image

Returns:

setSpeedUp

public void setSpeedUp(int rate)
speed up the speed

Parameters:
rate -

setDirection

public void setDirection(Direction dir)
set the direction the player is heading

Parameters:
direction -

getDirection

public Direction getDirection()
get the direction the player is heading

Returns:

setPlayerRowandCol

public void setPlayerRowandCol(int currentRow,
                               int currentColumn)
set the row and column position for the player

Parameters:
currentRow -
currentColumn -

getPlayerRow

public double getPlayerRow()
get the row position of the player

Returns:

getPlayerYPosition

public double getPlayerYPosition()
get the Y-coordinate position of the player

Returns:

getPlayerColumn

public double getPlayerColumn()
get the column position for the player

Returns:

getPlayerXPosition

public double getPlayerXPosition()
get the X-coordinate position for the player

Returns:

changePlayerColumn

public void changePlayerColumn(int amount)

changePlayerRow

public void changePlayerRow(int amount)

playerXDirectionMove

public double playerXDirectionMove()
routinely update the X-coordinate for the player (keep going in the same X-direction)

Returns:

playerYDirectionMove

public double playerYDirectionMove()
routinely update the Y-coordinate for the player (keep going in the same Y-direction)

Returns:

updatePlayerXPosition

public double updatePlayerXPosition(Direction playerDirection)
update the X-coordinate position of the player

Parameters:
playerDirection -
Returns:

updatePlayerYPosition

public double updatePlayerYPosition(Direction playerDirection)
update the Y-coordinate position for the player

Parameters:
playerDirection -
Returns:

playerInbound

public boolean playerInbound()
check to see if players are in bound

Returns:
true if players are still in bound

down

public void down()
handles down turning


left

public void left()
handles left turning


right

public void right()
handles right turning


up

public void up()
handles up turning


update

public void update(long elapsedTime)
Description copied from class: BetterSprite
Specify how the GameEntity Object should be updated.

Overrides:
update in class BetterSprite