vooga.games.towerdefense.actors
Class Player
java.lang.Object
com.golden.gamedev.object.Sprite
vooga.engine.core.BetterSprite
vooga.widget.MouseFollower
vooga.games.towerdefense.actors.Player
public class Player
- extends MouseFollower
Represents the player in the game. The player follows
the cursor and triggers a build tower event whenever
the player clicks. The image displayed is based on the
preview image of whatever tower the current tower is.
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 |
Player
public Player(java.awt.image.BufferedImage image,
double x,
double y,
BuildTowerEvent buildTower,
FindTargetEvent findTarget,
ShootEvent shootEvent,
Stat<java.lang.Integer> balance,
Stat<java.lang.Integer> score,
Stat<java.lang.Integer> selfEsteem)
update
public void update(long elapsedTime)
- Description copied from class:
BetterSprite
- Specify how the GameEntity Object should be updated.
- Overrides:
update
in class MouseFollower
onClick
public void onClick()
cheatOn
public void cheatOn()
withinBounds
public boolean withinBounds()
crossBorder
public boolean crossBorder()
checkOnPath
public boolean checkOnPath()
changeTowerType
public void changeTowerType(Tower newTower)
addMoney
public void addMoney(int money)
getSelfEsteem
public int getSelfEsteem()
removeSelfEsteem
public void removeSelfEsteem(int amount)
getScore
public int getScore()
getMoney
public int getMoney()
addScore
public void addScore(int amount)
addPathBoundary
public void addPathBoundary(java.util.List<PathPoint> pathPoints)