Class CocoonSpawnerComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.CocoonSpawnerComponent

public class CocoonSpawnerComponent extends Component
Cocoon Spawner Component - Spawns white cocoons when Boss health drops to 30% Works together with existing BossDefenseComponent for invulnerability Only handles cocoon spawning and tracking, not Boss defense state
  • Constructor Details

    • CocoonSpawnerComponent

      public CocoonSpawnerComponent(float healthThreshold, com.badlogic.gdx.math.Vector2[] cocoonPositions)
      Constructor
      Parameters:
      healthThreshold - Health percentage threshold to spawn cocoons (0.0-1.0)
      cocoonPositions - Array of spawn positions for cocoons
  • 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
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component
    • areCocoonsSpawned

      public boolean areCocoonsSpawned()
      Check if cocoons have been spawned
    • getRemainingCocoonsCount

      public int getRemainingCocoonsCount()
      Get remaining cocoons count
    • getActiveCocoons

      public List<Entity> getActiveCocoons()
      Get list of active cocoons (for debugging or special effects)
    • forceCleanupCocoons

      public void forceCleanupCocoons()
      Force cleanup all cocoons (for debugging or special cases)
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component