2019-12-21 03:32:02 +01:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
2019-12-23 17:38:27 +01:00
|
|
|
onready var target: = $Target
|
|
|
|
onready var arriver: = $Arriver
|
|
|
|
onready var gui: = $GUI
|
2019-12-22 20:23:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
gui.connect("align_tolerance_changed", self, "_on_GUI_align_tolerance_changed")
|
|
|
|
gui.connect("decel_radius_changed", self, "_on_GUI_decel_radius_changed")
|
|
|
|
gui.connect("max_speed_changed", self, "_on_GUI_max_speed_changed")
|
|
|
|
gui.connect("max_accel_changed", self, "_on_GUI_max_accel_changed")
|
|
|
|
gui.max_speed.text = str(arriver._agent.max_linear_speed)
|
|
|
|
gui.max_accel.text = str(arriver._agent.max_linear_acceleration)
|
|
|
|
gui.arrival_tolerance.text = str(arriver._arrive.arrival_tolerance)
|
|
|
|
gui.deceleration_radius.text = str(arriver._arrive.deceleration_radius)
|
2019-12-21 03:32:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
func draw(location: Vector2) -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
target.draw(location)
|
2019-12-22 20:23:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _on_GUI_align_tolerance_changed(value: int) -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
arriver._arrive.arrival_tolerance = value
|
2019-12-22 20:23:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _on_GUI_decel_radius_changed(value: int) -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
arriver._arrive.deceleration_radius = value
|
2019-12-22 20:23:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _on_GUI_max_speed_changed(value: int) -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
arriver._agent.max_linear_speed = value
|
2019-12-22 20:23:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _on_GUI_max_accel_changed(value: int) -> void:
|
2019-12-23 17:38:27 +01:00
|
|
|
arriver._agent.max_linear_acceleration = value
|