Human.Direction, Human.Mode, Human.State
Modifier and Type | Field and Description |
---|---|
static float |
ALERTED_ANIM_SPEED
Stores the multiplier of the zombie's walk animation when he is alerted and is following the player.
|
static float |
ALERTED_WALK_SPEED
Holds the walking speed of the zombie when he is following the player.
|
static float |
CHARGE_COLLIDER_HEIGHT |
static float |
CHARGE_COLLIDER_WIDTH
Stores the width and height of the zombie's charge collider in world units.
|
static float |
CHARGE_WALK_SPEED
Stores the horizontal speed of the zombie when he is charging.
|
static float |
COLLIDER_HEIGHT |
static float |
COLLIDER_WIDTH
Stores the width and height of the zombie's rectangle collider in world units.
|
static float |
COMBAT_WALK_SPEED
Stores the walk speed of the zombie in the horizontal direction when in COMBAT mode.
|
static float |
DEFAULT_CHARGE_DAMAGE
Holds the default amount of damage the CHARGE attack deals to the player.
|
static float |
DEFAULT_HEALTH
Holds the player's default health.
|
static float |
FALL_SPEED
Stores the downwards speed at which the zombie falls through a TerrainLayer.
|
static float |
INVULNERABLE_TIME
Holds the amount of time that the zombie is invulnerable when hit.
|
static float |
JUMP_SPEED
Stores the jump speed of the zombie in the vertical direction.
|
static float |
NORMAL_WALK_SPEED
Stores the walk speed of the zombie in the horizontal direction.
|
Constructor and Description |
---|
Zombie()
Creates a zombie whose bottom-center is at position (0, 0).
|
Zombie(float x,
float y)
Creates a zombie whose bottom-center is at position (x, y).
|
Modifier and Type | Method and Description |
---|---|
boolean |
canTarget()
Override the canTarget method as always returning false since the Zombie can never be targetted.
|
void |
chargeHit(Player player)
Make the zombie charge hit the player.
|
void |
fall()
Makes the zombie fall through one layer.
|
com.esotericsoftware.spine.AnimationState |
getAnimationState()
Retrieves the Spine AnimationState instance used to change the zombie's animations and control them.
|
Rectangle |
getArmCollider()
Returns the collider mapped to the zombie's arms.
|
Rectangle |
getChargeCollider()
Gets the collider mapped to the zombie when he's charging.
|
java.util.HashMap<java.lang.Class,java.lang.Float> |
getItemProbabilityMap()
Returns the HashMap which holds which items will be dropped when this InteractiveObject is scavenged.
|
com.esotericsoftware.spine.Bone |
getLeftHandBone()
Gets the bone mapped to the zombie's left hand.
|
com.esotericsoftware.spine.Bone |
getRightHandBone()
Gets the bone mapped to the zombie's right hand.
|
boolean |
isAlerted()
Returns true if the Zombie is aware that the Player is there.
|
boolean |
isTargetted()
Returns true if the zombie is being targetted by the player.
|
void |
jump()
Makes the zombie jump.
|
void |
loseTarget()
Called when the zombie loses his target.
|
void |
makeInvulnerable()
Makes the zombie invulnerable from the player's attacks for a given amount of seconds.
|
void |
setAlerted(boolean alerted)
Sets whether or not the Zombie is aware of the player.
|
void |
setAnimationState(com.esotericsoftware.spine.AnimationState animationState)
Sets the Spine AnimationState instance used to modify the zombie's animations and control them.
|
void |
setArmCollider(Rectangle armCollider)
Sets the collider mapped to the zombie's arms.
|
void |
setChargeCollider(Rectangle chargeCollider)
Sets the collider mapped to the zombie when he's charging.
|
void |
setItemProbabilityMap(java.util.HashMap<java.lang.Class,java.lang.Float> itemProbabilityMap)
Sets the HashMap which holds which items will be dropped when this InteractiveObject is scavenged.
|
void |
setLeftHandBone(com.esotericsoftware.spine.Bone leftHandBone)
Sets the bone mapped to the zombie's left hand.
|
void |
setRightHandBone(com.esotericsoftware.spine.Bone rightHandBone)
Sets the bone mapped to the zombie's right hand.
|
void |
setState(Human.State state)
Sets the state (IDLE, JUMP, etc.) of the GameObject, used to dictate which animations to use.
|
void |
setTargetted(boolean targetted)
Sets whether or not the zombie is being targetted by the player.
|
void |
update(float deltaTime)
Updates the zombie's internal game logic.
|
void |
updateColliders()
Updates the various colliders mapped to the zombie.
|
getDirection, getHealth, getInvulnerabilityTime, getMode, getPreviousState, getState, getTarget, getWalkSpeed, isDead, isFacing, isInvulnerable, isTargetReached, reset, setDirection, setHealth, setInvulnerabilityTime, setMode, setPreviousState, setTarget, setTargetReached, setWalkSpeed, takeDamage
getAcceleration, getCollider, getObjectId, getPosition, getPreviousPosition, getSkeleton, getStateTime, getTerrainCell, getVelocity, getX, getY, isAbove, moveTo, setAcceleration, setCollider, setObjectId, setPosition, setSkeleton, setStateTime, setTerrainCell, setVelocity, setVelocityX, setVelocityY, setX, setY, updateCollider, updatePosition
public static final float COLLIDER_WIDTH
public static final float COLLIDER_HEIGHT
public static final float NORMAL_WALK_SPEED
public static final float COMBAT_WALK_SPEED
public static final float ALERTED_WALK_SPEED
public static final float CHARGE_WALK_SPEED
public static final float DEFAULT_CHARGE_DAMAGE
public static final float ALERTED_ANIM_SPEED
public static final float JUMP_SPEED
public static final float FALL_SPEED
public static final float INVULNERABLE_TIME
public static final float DEFAULT_HEALTH
public static final float CHARGE_COLLIDER_WIDTH
public static final float CHARGE_COLLIDER_HEIGHT
public Zombie()
public Zombie(float x, float y)
public void updateColliders()
public void update(float deltaTime)
public void jump()
public void fall()
public void chargeHit(Player player)
public void loseTarget()
loseTarget
in class Human
public boolean canTarget()
canTarget
in class GameObject
public void setState(Human.State state)
Human
public com.esotericsoftware.spine.AnimationState getAnimationState()
public void setAnimationState(com.esotericsoftware.spine.AnimationState animationState)
public boolean isAlerted()
public void setAlerted(boolean alerted)
public void makeInvulnerable()
makeInvulnerable
in class Human
public boolean isTargetted()
public void setTargetted(boolean targetted)
public Rectangle getChargeCollider()
public void setChargeCollider(Rectangle chargeCollider)
public Rectangle getArmCollider()
public void setArmCollider(Rectangle armCollider)
public com.esotericsoftware.spine.Bone getRightHandBone()
public void setRightHandBone(com.esotericsoftware.spine.Bone rightHandBone)
public com.esotericsoftware.spine.Bone getLeftHandBone()
public void setLeftHandBone(com.esotericsoftware.spine.Bone leftHandBone)
public java.util.HashMap<java.lang.Class,java.lang.Float> getItemProbabilityMap()
public void setItemProbabilityMap(java.util.HashMap<java.lang.Class,java.lang.Float> itemProbabilityMap)