Class BossDeathComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.BossDeathComponent
Plays a one-shot explosion animation when the owning Boss entity dies,
then disposes the temporary effect entity and the Boss entity itself safely.
Assumptions: - The texture atlas "images/boss_explosion.atlas" is preloaded in ResourceService. - The atlas contains regions named "boss_explosion" with sequential indices (0..N). - The game's rendering uses nearest filtering for crisp pixel-art (as set in the atlas).
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault configuration: 0.06s per frame, scaled up 4×.BossDeathComponent
(float frameDuration, float scaleMultiplier) Custom configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Subscribes to the owning entity's "death" event when the component is created.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
BossDeathComponent
public BossDeathComponent()Default configuration: 0.06s per frame, scaled up 4×. Suitable for a large, impactful explosion without being too slow. -
BossDeathComponent
public BossDeathComponent(float frameDuration, float scaleMultiplier) Custom configuration.- Parameters:
frameDuration
- Seconds per frame, clamped to a small positive value.scaleMultiplier
- Scale multiplier for the explosion entity; integer values keep pixel-art crisp.
-
-
Method Details