vooga.games.towerdefense.actors.enemies
Class Enemy

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by vooga.engine.core.BetterSprite
          extended by vooga.games.towerdefense.actors.enemies.Enemy
Direct Known Subclasses:
EnemySpawn

public class Enemy
extends BetterSprite

The enemy sprite class which is defined by a speed, a path, a location, and health for each enemy.


Field Summary
protected  EnemyFailEvent myFailEvent
           
protected  EnemyHitEvent myHitEvent
           
protected  int myLoc
           
protected  java.util.List<PathPoint> myPath
           
 
Constructor Summary
Enemy(java.util.List<PathPoint> path, int speed, int lives, EnemyFailEvent failEvent, EnemyHitEvent hitEvent)
           
 
Method Summary
 int getLives()
           
 int getMoneyPerHit()
           
 int getScorePerHit()
           
 void gotHit()
          displays whether or not an enemy is hit
 void kill()
           
protected  void setImage()
          sets the image based on the number of lives
 void update(long elapsedTime)
          updates the parameters of the sprite based on the time
 
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

myPath

protected java.util.List<PathPoint> myPath

myLoc

protected int myLoc

myFailEvent

protected EnemyFailEvent myFailEvent

myHitEvent

protected EnemyHitEvent myHitEvent
Constructor Detail

Enemy

public Enemy(java.util.List<PathPoint> path,
             int speed,
             int lives,
             EnemyFailEvent failEvent,
             EnemyHitEvent hitEvent)
Method Detail

setImage

protected void setImage()
sets the image based on the number of lives


update

public void update(long elapsedTime)
updates the parameters of the sprite based on the time

Overrides:
update in class BetterSprite

getLives

public int getLives()

getScorePerHit

public int getScorePerHit()

getMoneyPerHit

public int getMoneyPerHit()

gotHit

public void gotHit()
displays whether or not an enemy is hit


kill

public void kill()