add anthill ui and bying units

This commit is contained in:
2024-10-06 15:56:04 +10:00
parent 0071d60fa1
commit 8096cd7046
17 changed files with 276 additions and 13 deletions

View File

@@ -23,6 +23,10 @@ func _process(delta: float) -> void:
_handle_wandering(delta)
static func get_cost() -> int:
return 5
func _handle_wandering(delta: float) -> void:
if state != AntNitwitState.WANDERING:
return

View File

@@ -5,6 +5,7 @@ signal moving_started
signal moving_ended
var anthill: Anthill
var spawn_pos: Vector3
var selected: bool = false
var moving_to_target: bool = false
@@ -26,6 +27,8 @@ func _ready() -> void:
set_selected(false)
super._ready()
if spawn_pos != null:
global_position = spawn_pos
func _physics_process(delta: float) -> void:
@@ -52,10 +55,14 @@ func _input(event: InputEvent) -> void:
func initialize(from: Anthill, pos: Vector3) -> ControlledUnit:
anthill = from
global_position = pos
spawn_pos = pos
return self
static func get_cost() -> int:
return 5
func set_selected(on: bool) -> void:
selected = on