Class Monster
- java.lang.Object
-
- net.egartley.beyondorigins.core.abstracts.Renderable
-
- net.egartley.beyondorigins.core.abstracts.Entity
-
- net.egartley.beyondorigins.core.abstracts.AnimatedEntity
-
- net.egartley.beyondorigins.entities.Monster
-
- All Implemented Interfaces:
Damageable
,Tickable
public class Monster extends AnimatedEntity implements Damageable
Test enemy
-
-
Field Summary
Fields Modifier and Type Field Description private int
ANIMATION_THRESHOLD
private DelayedEvent
hurtEvent
private boolean
isHurt
private byte
LEFT_HURT_ANIMATION
private byte
LEFT_NORMAL_ANIMATION
private byte
RIGHT_HURT_ANIMATION
private byte
RIGHT_NORMAL_ANIMATION
-
Fields inherited from class net.egartley.beyondorigins.core.abstracts.AnimatedEntity
animation, animations
-
Fields inherited from class net.egartley.beyondorigins.core.abstracts.Entity
boundaries, canCollide, defaultBoundary, deltaX, deltaY, DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, firstLayer, health, image, interactions, inventory, isAllowedToMoveDownwards, isAllowedToMoveLeftwards, isAllowedToMoveRightwards, isAllowedToMoveUpwards, isAnimated, isCollided, isDualRendered, isMovingDownwards, isMovingLeftwards, isMovingRightwards, isMovingUpwards, isSectorSpecific, isTraversable, lastCollision, lastCollisionEvent, maximumHealth, name, secondLayer, sheets, speed, sprite, sprites, uuid
-
-
Constructor Summary
Constructors Constructor Description Monster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
heal(int amount)
void
inflict(int amount)
void
onColdDeath()
void
onDeath()
void
setAnimations()
Sets the entity's animationsprotected void
setBoundaries()
Sets the entity's boundariesvoid
setCollisions()
Sets the entity's collisionsprotected void
setInteractions()
Sets the entity's interactionsvoid
tick()
Ticks boundaries and interactions-
Methods inherited from class net.egartley.beyondorigins.core.abstracts.AnimatedEntity
render, switchAnimation
-
Methods inherited from class net.egartley.beyondorigins.core.abstracts.Entity
allowAllMovement, drawDebug, drawFirstLayer, drawSecondLayer, move, onMove, onSectorEnter, onSectorLeave, setPosition, setSprite, setSprite, setSprites, toString, x, x, y, y
-
Methods inherited from class net.egartley.beyondorigins.core.abstracts.Renderable
x, y
-
-
-
-
Field Detail
-
ANIMATION_THRESHOLD
private final int ANIMATION_THRESHOLD
- See Also:
- Constant Field Values
-
LEFT_NORMAL_ANIMATION
private final byte LEFT_NORMAL_ANIMATION
- See Also:
- Constant Field Values
-
RIGHT_NORMAL_ANIMATION
private final byte RIGHT_NORMAL_ANIMATION
- See Also:
- Constant Field Values
-
LEFT_HURT_ANIMATION
private final byte LEFT_HURT_ANIMATION
- See Also:
- Constant Field Values
-
RIGHT_HURT_ANIMATION
private final byte RIGHT_HURT_ANIMATION
- See Also:
- Constant Field Values
-
isHurt
private boolean isHurt
-
hurtEvent
private DelayedEvent hurtEvent
-
-
Method Detail
-
onDeath
public void onDeath()
- Specified by:
onDeath
in interfaceDamageable
-
onColdDeath
public void onColdDeath()
- Specified by:
onColdDeath
in interfaceDamageable
-
setAnimations
public void setAnimations()
Description copied from class:AnimatedEntity
Sets the entity's animations- Specified by:
setAnimations
in classAnimatedEntity
- See Also:
AnimatedEntity.animations
-
setBoundaries
protected void setBoundaries()
Description copied from class:Entity
Sets the entity's boundaries- Specified by:
setBoundaries
in classEntity
- See Also:
Entity.boundaries
-
setCollisions
public void setCollisions()
Description copied from class:Entity
Sets the entity's collisions- Specified by:
setCollisions
in classEntity
- See Also:
Entity.boundaries
-
setInteractions
protected void setInteractions()
Description copied from class:Entity
Sets the entity's interactions- Specified by:
setInteractions
in classEntity
- See Also:
Entity.interactions
-
tick
public void tick()
Description copied from class:Entity
Ticks boundaries and interactions- Specified by:
tick
in interfaceTickable
- Overrides:
tick
in classEntity
- See Also:
Entity.boundaries
-
inflict
public void inflict(int amount)
- Specified by:
inflict
in interfaceDamageable
-
heal
public void heal(int amount)
- Specified by:
heal
in interfaceDamageable
-
-