Class PhysicsProjectileComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.physics.components.PhysicsProjectileComponent
Movement controller for a projectile entity
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Manifests the physics for the projectilevoid
fire
(com.badlogic.gdx.math.Vector2 direction, float speed) Fires a bullet in a certain direction at a certain speedvoid
setLived
(float lived) Setter function used for testsvoid
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.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
PhysicsProjectileComponent
public PhysicsProjectileComponent()
-
-
Method Details
-
create
public void create()Manifests the physics for the projectile -
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. -
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
-