Package com.deco2800.game.components.npc
Class EnemyAnimationController
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.npc.EnemyAnimationController
This class listens to events relevant to enemy entity's state and plays the animation when one
of the events is triggered.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Play animation when enemy moves eastvoid
Play animation when enemy moves northvoid
Play animation when enemy moves southvoid
Play animation when enemy moves westvoid
Play animation when enemy attacks in east directionvoid
Play animation when enemy attacks in north directionvoid
Play animation when enemy attacks in south directionvoid
Play animation when enemy attacks in west directionvoid
create()
Called when the entity is created and registered.void
Display default state enemy spriteMethods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
EnemyAnimationController
public EnemyAnimationController()
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
animateWest
public void animateWest()Play animation when enemy moves west -
animateEast
public void animateEast()Play animation when enemy moves east -
animateNorth
public void animateNorth()Play animation when enemy moves north -
animateSouth
public void animateSouth()Play animation when enemy moves south -
defaultAnimation
public void defaultAnimation()Display default state enemy sprite -
attackNorth
public void attackNorth()Play animation when enemy attacks in north direction -
attackSouth
public void attackSouth()Play animation when enemy attacks in south direction -
attackWest
public void attackWest()Play animation when enemy attacks in west direction -
attackEast
public void attackEast()Play animation when enemy attacks in east direction
-