2024-04-14 01:38:04 +00:00
|
|
|
extends Node2D
|
|
|
|
class_name MainGame
|
|
|
|
|
|
|
|
|
2024-04-14 02:09:36 +00:00
|
|
|
@onready var camera: GameCamera = $"GameCamera"
|
2024-04-16 01:02:19 +00:00
|
|
|
@onready var default_spawn_parent: Node2D = %"DefaultSpawnParent"
|
2024-04-21 21:49:34 +00:00
|
|
|
@onready var inventory: Inventory = %"Inventory"
|
2024-04-24 02:55:31 +00:00
|
|
|
@onready var cursor: Cursor = %"Cursor"
|
2024-04-19 02:30:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
static func get_via_group(node: Node) -> MainGame:
|
|
|
|
var result = node.get_tree().get_nodes_in_group("game")
|
|
|
|
if result.is_empty():
|
|
|
|
return null
|
|
|
|
return result[0]
|
2024-04-24 02:55:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
2024-04-24 02:56:44 +00:00
|
|
|
# Set up the gold display
|
2024-04-24 02:55:31 +00:00
|
|
|
var gold_counter = inventory.get_counter(&"Gold")
|
2024-04-24 02:56:44 +00:00
|
|
|
gold_counter.changed.connect(cursor.gold_display.display.unbind(1))
|
|
|
|
cursor.gold_display.set_text(gold_counter.value)
|