Class LaserProjectileComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.projectiles.LaserProjectileComponent

public class LaserProjectileComponent extends Component
Component for laser projectile entities that handles: - Movement in a straight line - Collision detection with player - Damage dealing - Hit effect (touchKillEffect) animation - Auto-disposal after hitting or traveling too far
  • Constructor Details

    • LaserProjectileComponent

      public LaserProjectileComponent(com.badlogic.gdx.math.Vector2 direction, float speed, Entity source)
      Creates a laser projectile component
      Parameters:
      direction - Normalized direction vector
      speed - Movement speed
      source - The entity that created this projectile (boss)
  • 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
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component