mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2025-01-01 13:49:49 +01:00
6276fc0413
Proof and edit docstrings in all the base types and proximity types Remove docstring for the _init builtin callback
16 lines
456 B
GDScript
16 lines
456 B
GDScript
class_name GSTFlee
|
|
extends GSTSeek
|
|
# Calculates acceleration to take an agent directly away from a target agent.
|
|
|
|
|
|
func _init(agent: GSTSteeringAgent, target: GSTAgentLocation).(agent, target) -> void:
|
|
pass
|
|
|
|
|
|
func _calculate_steering(acceleration: GSTTargetAcceleration) -> GSTTargetAcceleration:
|
|
acceleration.linear = (
|
|
(agent.position - target.position).normalized() * agent.linear_acceleration_max)
|
|
acceleration.angular = 0
|
|
|
|
return acceleration
|