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 TypeMethodDescriptionvoidPlay animation when enemy moves eastvoidPlay animation when enemy moves northvoidPlay animation when enemy moves southvoidPlay animation when enemy moves westvoidPlay animation when enemy attacks in east directionvoidPlay animation when enemy attacks in north directionvoidPlay animation when enemy attacks in south directionvoidPlay animation when enemy attacks in west directionvoidcreate()Called when the entity is created and registered.voidDisplay 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:ComponentCalled 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
-