Class BossLaserAttackComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.boss.BossLaserAttackComponent

public class BossLaserAttackComponent extends Component
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
  • Constructor Details

    • BossLaserAttackComponent

      public BossLaserAttackComponent(Entity target)
      Creates a new BossLaserAttackComponent
      Parameters:
      target - The player entity to target
  • 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.
      Overrides:
      create in class Component
    • 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.
      Overrides:
      update in class Component
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables laser attacks
      Overrides:
      setEnabled in class Component
      Parameters:
      enabled - Whether laser attacks should be enabled
    • setTarget

      public void setTarget(Entity newTarget)
      Sets the target entity (player)
      Parameters:
      newTarget - The new target entity
    • getTarget

      public Entity getTarget()
      Gets the current target entity
      Returns:
      The target entity