godot-steering-ai-framework/project/src/Behaviors/GSTEvade.gd
2020-01-29 10:13:12 -06:00

16 lines
347 B
GDScript

# Calculates acceleration to take an agent away from where a target agent is
# moving.
class_name GSTEvade
extends GSTPursue
func _init(
agent: GSTSteeringAgent,
target: GSTSteeringAgent,
predict_time_max := 1.0).(agent, target, predict_time_max):
pass
func _get_modified_acceleration() -> float:
return -agent.linear_acceleration_max