mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
16 lines
424 B
GDScript
16 lines
424 B
GDScript
# Calculates acceleration to take an agent directly away from a target agent.
|
|
class_name GSAIFlee
|
|
extends GSAISeek
|
|
|
|
|
|
func _init(agent: GSAISteeringAgent, target: GSAIAgentLocation).(agent, target) -> void:
|
|
pass
|
|
|
|
|
|
func _calculate_steering(acceleration: GSAITargetAcceleration) -> void:
|
|
acceleration.linear = (
|
|
(agent.position - target.position).normalized()
|
|
* agent.linear_acceleration_max
|
|
)
|
|
acceleration.angular = 0
|