Class ProjectileMovementTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.components.tasks.ProjectileMovementTask
- All Implemented Interfaces:
PriorityTask
,Task
Chases a target entity until they get too far away or line of sight is lost
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status
-
Field Summary
FieldsFields inherited from class com.csse3200.game.ai.tasks.DefaultTask
owner, status
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus, setOwner, stop
-
Field Details
-
priority
protected final int priority -
physics
-
-
Constructor Details
-
ProjectileMovementTask
- Parameters:
target
- The entity to chase.priority
- Task priority when chasing (0 when not chasing).
-
-
Method Details
-
start
public void start()Moves the entity in the direction of the entities target (often the player)- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
update
public void update()Updates the direction in which the entity needs to move in, checks every frame to see where the player is to determine this.- Specified by:
update
in interfaceTask
- Overrides:
update
in classDefaultTask
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfacePriorityTask
-
getMovementTask
MovementTask getter- Returns:
- Movement task of this projectile
-