Align patterns better around what UI components are. Move script related controllers to scripts folder

This commit is contained in:
2026-08-15 14:33:06 -05:00
parent 3fcabe1a53
commit 4d54f8de37
14 changed files with 20 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
class_name GameState extends Node
func _init() -> void:
Globals.game_state = self
func set_game_scene(scene_str: String) -> void:
var scene = load(scene_str).instantiate()
var target = get_tree().root.find_child("scene", true, false)
scene.name = "lobby_screen"
clear_game_scene(target)
target.add_child(scene)
func clear_game_scene(container: Node) -> void:
for child in container.get_children():
child.queue_free()
await get_tree().process_frame