mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-11-14 04:57:19 +01:00
3d50dcdb9c
Being toy demos, they should be easily tweakable and modifiable by the user to get a feel for what the parameters of the behaviors do.
29 lines
655 B
GDScript
29 lines
655 B
GDScript
extends MarginContainer
|
|
|
|
|
|
enum BehaviorMode { SEEK, FLEE }
|
|
|
|
signal mode_changed(behavior_mode)
|
|
|
|
onready var seek: CheckBox = $BehaviorControls/Seek
|
|
onready var flee: CheckBox = $BehaviorControls/Flee
|
|
|
|
|
|
func _ready() -> void:
|
|
seek.connect("pressed", self, "_on_Seek_pressed")
|
|
flee.connect("pressed", self, "_on_Flee_pressed")
|
|
|
|
|
|
func _on_Seek_pressed() -> void:
|
|
flee.pressed = false
|
|
flee.button_mask = BUTTON_MASK_LEFT
|
|
seek.button_mask = 0
|
|
emit_signal("mode_changed", BehaviorMode.SEEK)
|
|
|
|
|
|
func _on_Flee_pressed() -> void:
|
|
seek.pressed = false
|
|
seek.button_mask = BUTTON_MASK_LEFT
|
|
flee.button_mask = 0
|
|
emit_signal("mode_changed", BehaviorMode.FLEE)
|