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 voidPlay idle animation when no action animation is currently playingprotected voidPlay run animation when no action animation is currently playingprotected voidPlay walk animation when no action animation is currently playingvoidcreate()Initializes the HostileAnimationController when it is created.voidupdate()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:
createin classAnimalAnimationController
-
animateIdle
protected void animateIdle()Play idle animation when no action animation is currently playing- Overrides:
animateIdlein classAnimalAnimationController
-
animateWalk
protected void animateWalk()Play walk animation when no action animation is currently playing- Overrides:
animateWalkin classAnimalAnimationController
-
animateRun
protected void animateRun()Play run animation when no action animation is currently playing- Overrides:
animateRunin classAnimalAnimationController
-
update
public void update()Trigger animation when active animation is finished
-