add comments to managers

This commit is contained in:
Teatov 2024-10-13 19:52:21 +10:00
parent c1df8daf5f
commit 7b069f062c
9 changed files with 16 additions and 3 deletions

View File

@ -60,7 +60,11 @@ func _click() -> void:
UiManager.anthill_info.open(self)
func _create_unit(unit_scene: PackedScene, cost: int, ding: bool = true) -> ControlledUnit:
func _create_unit(
unit_scene: PackedScene,
cost: int,
ding: bool = true,
) -> ControlledUnit:
var new_honeydew_amount := honeydew - cost
print(new_honeydew_amount)
if new_honeydew_amount < 0:
@ -73,7 +77,7 @@ func _create_unit(unit_scene: PackedScene, cost: int, ding: bool = true) -> Cont
var new_unit := (
(unit_scene.instantiate() as ControlledUnit).initialize(
self,
new_pos
new_pos,
)
)
if ding:

View File

@ -1,4 +1,5 @@
extends Node
## Handles cursor confinement and animation
const CURSOR_HOTSPOT = Vector2(32, 32)

View File

@ -1,4 +1,5 @@
extends CanvasLayer
## Handles displaying debug info
const LINE_WIDTH: float = 2
const MARKER_RADIUS: float = 0.2

View File

@ -1,4 +1,5 @@
extends Node
## Handles fullscreen toggling
var is_fullscreen: bool = false

View File

@ -1,4 +1,5 @@
extends Node3D
## Handles mouse hovering over units
var hovered_node: Variant
var mouse_pos: Vector2 = Vector2.ZERO

View File

@ -1,4 +1,5 @@
extends Node
## Handles selection of units
const MIN_DRAG_DISTANCE: float = 15
const UNIT_SELECT_OFFSET: float = 0.25

View File

@ -1,4 +1,5 @@
extends Node
## Holds all the sound effects for quick use
var pop_streams: Array[AudioStream] = [
preload("res://assets/audio/units/pop_1.wav"),

View File

@ -1,13 +1,15 @@
extends Node
## Holds references to nodes that other scripts reference
@onready var player_anthill: Anthill = $/root/World/Structures/Anthill
@onready var main_camera: MainCamera = $/root/World/MainCamera
# Unit holders
@onready var nitwits_holder: Node = $/root/World/Units/Nitwits
@onready var gatherers_holder: Node = $/root/World/Units/Gatherers
@onready var aphids_holder: Node = $/root/World/Units/Aphids
# Item holders
@onready var honeydew_holder: Node = $/root/World/Items/Honeydew
func _ready() -> void:

View File

@ -1,4 +1,5 @@
extends Node
## Holds references to all the menus
@onready var anthill_info: AnthillInfo = $/root/World/UI/AnthillInfo
@onready var buy_ants: BuyAnts = $/root/World/UI/BuyAnts