add unit creation from anthill

This commit is contained in:
2024-10-06 14:41:09 +10:00
parent d4d4b563c0
commit 0071d60fa1
2 changed files with 26 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ class_name ControlledUnit
signal moving_started
signal moving_ended
var anthill: Anthill
var selected: bool = false
var moving_to_target: bool = false
var ground_plane: Plane = Plane(Vector3.UP, 0)
@@ -48,6 +50,12 @@ func _input(event: InputEvent) -> void:
_set_target_click(button_event.position)
func initialize(from: Anthill, pos: Vector3) -> ControlledUnit:
anthill = from
global_position = pos
return self
func set_selected(on: bool) -> void:
selected = on