Class CocoonSpawnerComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.CocoonSpawnerComponent
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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCocoonSpawnerComponent
(float healthThreshold, com.badlogic.gdx.math.Vector2[] cocoonPositions) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if cocoons have been spawnedvoid
create()
Called when the entity is created and registered.void
dispose()
Called when the component is disposed.void
Force cleanup all cocoons (for debugging or special cases)Get list of active cocoons (for debugging or special effects)int
Get remaining cocoons countvoid
update()
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
-
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. -
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. -
areCocoonsSpawned
public boolean areCocoonsSpawned()Check if cocoons have been spawned -
getRemainingCocoonsCount
public int getRemainingCocoonsCount()Get remaining cocoons count -
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.
-