|
|||||||||
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.examples.networking.zombies.Zombie
public class Zombie
Zombie Class. Contains all behavior and controls for zombies in the game
Field Summary |
---|
Fields inherited from interface vooga.examples.networking.zombies.Constants |
---|
ATTACKDOWN, ATTACKLEFT, ATTACKRIGHT, ATTACKUP, DEATH, DEFAULT_RESOURCE_DIRECTORY, GAME_HEIGHT, GAME_WIDTH, MAIN_CLASS, PLAYER_CLASS, PLAYER_DOWN, PLAYER_LEFT, PLAYER_RIGHT, PLAYER_UP, RESOURCE_FILENAME, STATES_XML_PATH, XML_PATH, ZOMBIE_DOWN, ZOMBIE_LEFT, ZOMBIE_RIGHT, ZOMBIE_UP |
Constructor Summary | |
---|---|
Zombie(java.lang.String name,
int level,
Shooter player,
PlayState state)
|
Method Summary | |
---|---|
void |
calculateDamage(double damage)
Update the zombie's health according to the damage taken |
double |
getDamage()
Get the damage of the zombie |
java.lang.String |
getDirection()
Returns the attack direction of the zombie. |
double |
getHealth()
|
boolean |
isAbleToAttack()
Tests to see if the AttackDelayStep has reached the threshold defined by AtttackDelay. |
boolean |
isDead()
Tests whether the zombie has a health of 0. |
void |
resetAttackDelayStep()
reset attack step |
void |
setAttackAnimation(java.lang.String side)
Set the label for the current attack animation so it corresponds to the attack direction of the zombie |
void |
setDropItemListener(IEventHandler listener)
This method sets up the drop item event |
void |
update(long elapsedTime)
Keep track of heath and controls animation, movement, and item drop |
void |
updateAttackStep()
Update attack step. |
void |
updateStats(int level)
|
static int |
zombiesPerLevel()
|
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 |
Constructor Detail |
---|
public Zombie(java.lang.String name, int level, Shooter player, PlayState state)
Method Detail |
---|
public void updateStats(int level)
public double getHealth()
public static int zombiesPerLevel()
public boolean isDead()
public boolean isAbleToAttack()
public double getDamage()
public java.lang.String getDirection()
public void calculateDamage(double damage)
damage
- damage taken by the zombiepublic void updateAttackStep()
public void resetAttackDelayStep()
public void setAttackAnimation(java.lang.String side)
side
- attack directionpublic void update(long elapsedTime)
update
in class BetterSprite
public void setDropItemListener(IEventHandler listener)
listener
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |