Class JumpTask
java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
com.deco2800.game.components.tasks.JumpTask
- All Implemented Interfaces:
PriorityTask,Task
Jump to an entity and attack it if it is still in attacking range.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.deco2800.game.ai.tasks.Task
Task.Status -
Field Summary
Fields inherited from class com.deco2800.game.ai.tasks.DefaultTask
owner, status -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.deco2800.game.ai.tasks.DefaultTask
create, getStatus
-
Constructor Details
-
JumpTask
public JumpTask(Entity target, int priority, float attackRange, float glidingSpeed, float knockBackForce) Create a JumpTask with target, attack range, gliding speed and knock back distance.- Parameters:
target- The target entity will be jumped at.priority- Task priority when jumping.attackRange- Maximum distance from the entity while gliding before giving up.glidingSpeed- The speed to glide at.knockBackForce- The magnitude of the knock back applied to the entity.
-
-
Method Details
-
start
public void start()Start the jump task.- Specified by:
startin interfaceTask- Overrides:
startin classDefaultTask
-
update
public void update()Update the jump task.- Specified by:
updatein interfaceTask- Overrides:
updatein classDefaultTask
-
stop
public void stop()Stop the jump task.- Specified by:
stopin interfaceTask- Overrides:
stopin classDefaultTask
-
getPriority
public int getPriority()Get the priority of this task.- Specified by:
getPriorityin interfacePriorityTask- Returns:
- integer representing the priority of this task.
-