Class DeathParticleSpawnerComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.DeathParticleSpawnerComponent
Spawns a one-shot explosion particle animation when the attached enemy dies.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DeathParticleSpawnerComponent
(String animationName) Constructor with custom animation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
DeathParticleSpawnerComponent
public DeathParticleSpawnerComponent()Default constructor. Uses the default death animation ("explosion_1"). -
DeathParticleSpawnerComponent
Constructor with custom animation. Sets the animation to the given name if valid; adjusts frame duration if necessary. Throws IllegalArgumentException if the animation name is invalid.- Parameters:
animationName
- the name of the death animation to use
-
-
Method Details