Class ProjectileBoundsComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.physics.components.ProjectileBoundsComponent

public class ProjectileBoundsComponent extends Component
This component ensures that the projectile entity is disposed off when the laser leaves the boundaries of the game window/map. The worldWidth and worldHeight variables are required to establish the game boundaries. update() checks the current position of the entity(i.e. laser) and disposes it if out of bounds.
  • Constructor Details

    • ProjectileBoundsComponent

      public ProjectileBoundsComponent(float worldWidth, float worldHeight)
  • Method Details

    • 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