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 TypeMethodDescriptionvoidvoidcreate()Called when the entity is created and registered.protected com.badlogic.gdx.math.Vector2protected voidsetToVelocity(com.badlogic.gdx.physics.box2d.Body body, com.badlogic.gdx.math.Vector2 desiredVelocity) voidupdate()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, setTargetMethods 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:ComponentCalled 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:
createin classPhysicsMovementComponent
-
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled.- Overrides:
updatein classPhysicsMovementComponent
-
getDirection
protected com.badlogic.gdx.math.Vector2 getDirection()- Overrides:
getDirectionin classPhysicsMovementComponent
-
setToVelocity
protected void setToVelocity(com.badlogic.gdx.physics.box2d.Body body, com.badlogic.gdx.math.Vector2 desiredVelocity) - Overrides:
setToVelocityin classPhysicsMovementComponent
-
checkCollision
public void checkCollision()
-