Class BossSpawnerComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.BossSpawnerComponent
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.
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBossSpawnerComponent(List<com.badlogic.gdx.math.Vector2> spawnTriggers, float spawnInterval) Create boss drone spawn component with configurable triggers -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpawnTrigger(com.badlogic.gdx.math.Vector2 trigger) Add a new spawn trigger dynamicallyvoidClean up all spawned dronesvoidcreate()Called when the entity is created and registered.voiddispose()Called when the component is disposed.intGet current active trigger indexGet the player entity for testing purposesintGet number of triggersbooleanisTriggerActivated(int index) Check if specific trigger has been activatedvoidReset all triggers (for level reset)voidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
BossSpawnerComponent
Create boss drone spawn component with configurable triggers- Parameters:
spawnTriggers- List of player position thresholds that trigger spawningspawnInterval- Time between drone spawns during active phase (old use)
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled 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. -
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
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:ComponentCalled when the component is disposed. Dispose of any internal resources here. -
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
Get the player entity for testing purposes- Returns:
- player entity
-