Class DeathParticleSpawnerComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.DeathParticleSpawnerComponent

public class DeathParticleSpawnerComponent extends Component
Spawns a one-shot explosion particle animation when the attached enemy dies.
  • Constructor Details

    • DeathParticleSpawnerComponent

      public DeathParticleSpawnerComponent()
      Default constructor. Uses the default death animation ("explosion_1").
    • DeathParticleSpawnerComponent

      public DeathParticleSpawnerComponent(String animationName)
      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

    • create

      public void create()
      Description copied from class: Component
      Called 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.
      Overrides:
      create in class Component