Class Boss3HealthPhaseSwitcher
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.Boss3HealthPhaseSwitcher
A component that switches Boss-3's rendering from a static PNG
This allows the boss to visually "crack" or change form at 50%, 40%, and 25% health. The atlas is pre-attached during entity creation, but disabled until triggered.
The thresholds are ratios of current health / max health.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
Boss3HealthPhaseSwitcher
-
-
Method Details
-
addPhase
-
create
public void create()Called when the component is created. Sorts thresholds in descending order and applies the correct phase immediately (in case the boss spawns below full health). -
update
public void update()Called once per frame. Checks current health ratio and applies phase changes when thresholds are crossed.
-