Package com.csse3200.game.components.npc
Class AnimalEffectsController
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.npc.AnimalEffectsController
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
A component responsible for managing animation effects for animal entities in the game.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Initializes the AnimalEffectsController and sets up event listeners for managing animation effects.void
startEffect
(String trigger) Starts a specific animation effect for the animal entity based on the given trigger.void
startTimedEffect
(String trigger, float duration) Starts a timed animation effect for the animal entity based on the given trigger and duration.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update, write
-
Constructor Details
-
AnimalEffectsController
public AnimalEffectsController()
-
-
Method Details
-
create
public void create()Initializes the AnimalEffectsController and sets up event listeners for managing animation effects. -
startEffect
Starts a specific animation effect for the animal entity based on the given trigger.- Parameters:
trigger
- The trigger for the animation effect, such as "tamed," "fed," "runAwayStart," etc.
-
startTimedEffect
Starts a timed animation effect for the animal entity based on the given trigger and duration.- Parameters:
trigger
- The trigger for the animation effect, such as "tamed," "fed," "runAwayStart," etc.duration
- The duration (in seconds) for which the animation effect should be active.
-