Class PhysicsProjectileComponent

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

public class PhysicsProjectileComponent extends Component
Movement controller for a projectile entity
  • Constructor Details

    • PhysicsProjectileComponent

      public PhysicsProjectileComponent()
  • Method Details

    • create

      public void create()
      Manifests the physics for the projectile
      Overrides:
      create in class Component
    • update

      public void update()
      Checks how long the projectile has been alive for, adding it to the "to remove list" within entity service if it has exceeded this time.
      Overrides:
      update in class Component
    • fire

      public void fire(com.badlogic.gdx.math.Vector2 direction, float speed)
      Fires a bullet in a certain direction at a certain speed
    • setLived

      public void setLived(float lived)
      Setter function used for tests
      Parameters:
      lived - assigned lived time for a projectile