Class BossSpawnerComponent

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

public class BossSpawnerComponent extends Component
Boss three-stage drone spawning component: * - Phase transitions based on the player's position as a trigger point; * - Each phase is configurable: drone variant, spawn interval, concurrency limit, total spawns, and pre-swing duration; * - Phase completion condition: Full spawns AND active count on the field is 0 -> switch back to pursuit animation/behavior.
  • Constructor Details

    • BossSpawnerComponent

      public BossSpawnerComponent(List<com.badlogic.gdx.math.Vector2> spawnTriggers, float spawnInterval)
      Create boss drone spawn component with configurable triggers
      Parameters:
      spawnTriggers - List of player position thresholds that trigger spawning
      spawnInterval - Time between drone spawns during active phase (old 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
    • 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
    • resetTriggers

      public void resetTriggers()
      Reset all triggers (for level reset)
    • cleanupDrones

      public void cleanupDrones()
      Clean up all spawned drones
    • 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
    • addSpawnTrigger

      public void addSpawnTrigger(com.badlogic.gdx.math.Vector2 trigger)
      Add a new spawn trigger dynamically
    • getCurrentTriggerIndex

      public int getCurrentTriggerIndex()
      Get current active trigger index
    • isTriggerActivated

      public boolean isTriggerActivated(int index)
      Check if specific trigger has been activated
    • getTriggerCount

      public int getTriggerCount()
      Get number of triggers
    • getPlayer

      public Entity getPlayer()
      Get the player entity for testing purposes
      Returns:
      player entity