|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSprite
vooga.games.tron.players.TronPlayer
public class TronPlayer
Field Summary | |
---|---|
boolean[][] |
blocks
|
int |
score
|
Constructor Summary | |
---|---|
TronPlayer(java.awt.image.BufferedImage image,
double initialColPosition,
double initialRowPosition,
GridSpace gridSpace,
int playerImageWidth,
java.lang.String initialDirection)
constructor |
Method Summary | |
---|---|
void |
fillBlock(double row,
double col)
mark the block if it is filled by items in the game |
java.lang.String |
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 |
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 |
setDirection(java.lang.String direction)
set the direction the player is heading |
void |
setPlayerColumn(int amount)
|
void |
setPlayerRow(int amount)
|
void |
setPlayerRowandCol(double currentRow,
double currentColumn)
set the row and column position for the player |
void |
setSpeedUp(int rate)
speed up the speed |
double |
updatePlayerXPosition(java.lang.String playerDirection)
update the X-coordinate position of the player |
double |
updatePlayerYPosition(java.lang.String playerDirection)
update the Y-coordinate position for the player |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean[][] blocks
public int score
Constructor Detail |
---|
public TronPlayer(java.awt.image.BufferedImage image, double initialColPosition, double initialRowPosition, GridSpace gridSpace, int playerImageWidth, java.lang.String initialDirection)
image
- initialColPosition
- initialRowPosition
- gridSpace
- playerImageWidth
- initialDirection
- Method Detail |
---|
public void resetPosition()
public void fillBlock(double row, double col)
row
- col
- public int getImageWidth()
public void setSpeedUp(int rate)
rate
- public void setDirection(java.lang.String direction)
direction
- public java.lang.String getDirection()
public void setPlayerRowandCol(double currentRow, double currentColumn)
currentRow
- currentColumn
- public double getPlayerRow()
public double getPlayerYPosition()
public double getPlayerColumn()
public double getPlayerXPosition()
public void setPlayerColumn(int amount)
public void setPlayerRow(int amount)
public double playerXDirectionMove()
public double playerYDirectionMove()
public double updatePlayerXPosition(java.lang.String playerDirection)
playerDirection
-
public double updatePlayerYPosition(java.lang.String playerDirection)
playerDirection
-
public boolean playerInbound()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |