godot-steering-ai-framework/project/demos/AvoidCollisions/AvoidCollisionsDemo.gd
Nathan Lovato 6132a0aa25 Refactor the demos to support screen resizing
Add BackgroudLayer and DemoInterface scenes that we can reuse across demos
Set the game to 2D and extend window modes

Part of #21
2020-02-08 15:40:43 -06:00

42 lines
970 B
GDScript

extends Node
export(float, 0, 2000, 40) var linear_speed_max := 350.0 setget set_linear_speed_max
export(float, 0, 100, 2) var linear_acceleration_max := 40.0 setget set_linear_accel_max
export(float, 0, 500, 10) var proximity_radius := 140.0 setget set_proximity_radius
export var draw_proximity := true setget set_draw_proximity
onready var spawner := $Spawner
func set_linear_speed_max(value: float) -> void:
linear_speed_max = value
if not is_inside_tree():
return
spawner.set_linear_speed_max(value)
func set_linear_accel_max(value: float) -> void:
linear_acceleration_max = value
if not is_inside_tree():
return
spawner.set_linear_accel_max(value)
func set_proximity_radius(value: float) -> void:
proximity_radius = value
if not is_inside_tree():
return
spawner.set_proximity_radius(value)
func set_draw_proximity(value: bool) -> void:
draw_proximity = value
if not is_inside_tree():
return
spawner.set_draw_proximity(value)