Class BossLaserAttackComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.BossLaserAttackComponent
BossLaserAttackComponent handles the boss's laser pulse attack:
- Finds player position
- Triggers bossShootLaser animation
- Creates and shoots laser pulse projectile with shootEffect animation
- Handles hit detection and damage through the projectile entity
- Uses touchKillEffect as hit effect when player is damaged
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBossLaserAttackComponent(Entity target) Creates a new BossLaserAttackComponent -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when the entity is created and registered.Gets the current target entityvoidsetEnabled(boolean enabled) Enables or disables laser attacksvoidSets the target entity (player)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
dispose, earlyUpdate, getEntity, getPrio, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
BossLaserAttackComponent
Creates a new BossLaserAttackComponent- Parameters:
target- The player entity to target
-
-
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. -
setEnabled
public void setEnabled(boolean enabled) Enables or disables laser attacks- Overrides:
setEnabledin classComponent- Parameters:
enabled- Whether laser attacks should be enabled
-
setTarget
Sets the target entity (player)- Parameters:
newTarget- The new target entity
-
getTarget
Gets the current target entity- Returns:
- The target entity
-