|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.object.Sprite
vooga.engine.core.BetterSprite
vooga.games.tronupdate.items.TronPlayer
public class TronPlayer
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 |
---|
public GridSpace grid
Constructor Detail |
---|
public TronPlayer(java.awt.image.BufferedImage image, int initialColPosition, int initialRowPosition, int playerImageWidth, java.lang.String initialDirection)
image
- initialColPosition
- initialRowPosition
- gridSpace
- playerImageWidth
- initialDirection
- public TronPlayer(java.awt.image.BufferedImage image, int initialColPosition, int initialRowPosition, int playerImageWidth, Direction dir)
Method Detail |
---|
public void resetPosition()
public void setAsAI(boolean flag)
public boolean isAI()
public void fillBlock(int row, int col)
row
- col
- public int getImageWidth()
public void setSpeedUp(int rate)
rate
- public void setDirection(Direction dir)
direction
- public Direction getDirection()
public void setPlayerRowandCol(int currentRow, int currentColumn)
currentRow
- currentColumn
- public double getPlayerRow()
public double getPlayerYPosition()
public double getPlayerColumn()
public double getPlayerXPosition()
public void changePlayerColumn(int amount)
public void changePlayerRow(int amount)
public double playerXDirectionMove()
public double playerYDirectionMove()
public double updatePlayerXPosition(Direction playerDirection)
playerDirection
-
public double updatePlayerYPosition(Direction playerDirection)
playerDirection
-
public boolean playerInbound()
public void down()
public void left()
public void right()
public void up()
public void update(long elapsedTime)
BetterSprite
update
in class BetterSprite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |