Package com.csse3200.game.components.npc
Class HostileAnimationController
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.npc.AnimalAnimationController
com.csse3200.game.components.npc.HostileAnimationController
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
The HostileAnimationController class is responsible for controlling the animations of a hostile NPC entity.
It extends the behavior of the AnimalAnimationController and includes functionality for playing attack animations.
-
Field Summary
Fields inherited from class com.csse3200.game.components.npc.AnimalAnimationController
animator, currentAnimation, direction, IDLE_PREFIX, RUN_PREFIX, WALK_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Play idle animation when no action animation is currently playingprotected void
Play run animation when no action animation is currently playingprotected void
Play walk animation when no action animation is currently playingvoid
create()
Initializes the HostileAnimationController when it is created.void
update()
Trigger animation when active animation is finishedMethods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, write
-
Constructor Details
-
HostileAnimationController
public HostileAnimationController()
-
-
Method Details
-
create
public void create()Initializes the HostileAnimationController when it is created. Sets up event listeners to trigger animations when event occurs.- Overrides:
create
in classAnimalAnimationController
-
animateIdle
protected void animateIdle()Play idle animation when no action animation is currently playing- Overrides:
animateIdle
in classAnimalAnimationController
-
animateWalk
protected void animateWalk()Play walk animation when no action animation is currently playing- Overrides:
animateWalk
in classAnimalAnimationController
-
animateRun
protected void animateRun()Play run animation when no action animation is currently playing- Overrides:
animateRun
in classAnimalAnimationController
-
update
public void update()Trigger animation when active animation is finished
-