Class ActiveProjectile

java.lang.Object
com.csse3200.game.entities.Entity
com.csse3200.game.entities.configs.projectiles.ActiveProjectile

public class ActiveProjectile extends Entity
An extension of current projectile functionality based in Entity, so that it's trajectory and flight path are affected during runtime. Includes things like following a specific target, and being affected by gravity in a 2D platformer setting.
  • Constructor Details

    • ActiveProjectile

      public ActiveProjectile()
  • Method Details

    • setGravityStrength

      public void setGravityStrength(float gravityStrength)
      Sets the gravity strength of the projectile, used if set to ARC projectile type.
      Parameters:
      gravityStrength - The strength of the gravity affecting the projectile
    • setTarget

      public void setTarget(Entity target)
      Sets the target that the projectile will continuously follow, used if set to FOLLOW_TARGET projectile type.
      Parameters:
      target - The target entity to follow/home into
    • setActiveProjectileType

      public void setActiveProjectileType(ActiveProjectileTypes type)
      Sets the projectile type of this active projectile
      Parameters:
      type - The type of this active projectile
    • setProjectileSpeed

      public void setProjectileSpeed(float speed)
    • create

      public void create()
      Description copied from class: Entity
      Create the entity and start running. This is called when the entity is registered in the world, and should not be called manually.
      Overrides:
      create in class Entity
    • update

      public void update()
      Description copied from class: Entity
      Perform an update on all components. This is called by the entity service and should not be called manually.
      Overrides:
      update in class Entity