godot-steering-ai-framework/project/src/Behaviors/GSTEvade.gd

15 lines
343 B
GDScript3
Raw Normal View History

class_name GSTEvade
2020-01-16 23:14:50 +01:00
extends GSTPursue
# Calculates acceleration to take an agent away from where a target agent will be.
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