mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-11-14 04:57:19 +01:00
9f945cbf85
Razvan reviewed the code and suggested a number of changes to improve readability and make facets of the code more explicit and consistent.
24 lines
753 B
GDScript
24 lines
753 B
GDScript
extends Node2D
|
|
|
|
|
|
onready var gui: = $GUI
|
|
onready var pursuer: = $BoundaryManager/Pursuer
|
|
onready var seeker: = $BoundaryManager/Seeker
|
|
|
|
|
|
func _ready() -> void:
|
|
gui.linear_speed.text = str(pursuer.agent.max_linear_speed)
|
|
gui.linear_accel.text = str(pursuer.agent.max_linear_acceleration)
|
|
gui.connect("linear_accel_changed", self, "_on_GUI_linear_accel_changed")
|
|
gui.connect("linear_speed_changed", self, "_on_GUI_linear_speed_changed")
|
|
|
|
|
|
func _on_GUI_linear_accel_changed(value: int) -> void:
|
|
pursuer.agent.max_linear_acceleration = float(value)
|
|
seeker.agent.max_linear_acceleration = float(value)
|
|
|
|
|
|
func _on_GUI_linear_speed_changed(value: int) -> void:
|
|
pursuer.agent.max_linear_speed = float(value)
|
|
seeker.agent.max_linear_speed = float(value)
|