Class ProjectileMovementComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.physics.components.PhysicsMovementComponent
com.deco2800.game.physics.components.ProjectileMovementComponent
- All Implemented Interfaces:
MovementController
-
Field Summary
Fields inherited from class com.deco2800.game.physics.components.PhysicsMovementComponent
physicsComponent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
create()
Called when the entity is created and registered.protected com.badlogic.gdx.math.Vector2
protected void
setToVelocity
(com.badlogic.gdx.physics.box2d.Body body, com.badlogic.gdx.math.Vector2 desiredVelocity) void
update()
Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.deco2800.game.physics.components.PhysicsMovementComponent
getMoving, getSpeed, getTarget, resetSpeed, setMoving, setNewSpeed, setOriginalSpeed, setTarget
Methods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ProjectileMovementComponent
public ProjectileMovementComponent()
-
-
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 classPhysicsMovementComponent
-
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 classPhysicsMovementComponent
-
getDirection
protected com.badlogic.gdx.math.Vector2 getDirection()- Overrides:
getDirection
in classPhysicsMovementComponent
-
setToVelocity
protected void setToVelocity(com.badlogic.gdx.physics.box2d.Body body, com.badlogic.gdx.math.Vector2 desiredVelocity) - Overrides:
setToVelocity
in classPhysicsMovementComponent
-
checkCollision
public void checkCollision()
-