Graphical Overhaul

This commit is contained in:
Exobyt 2024-08-20 16:59:16 +02:00
parent b9eec60df7
commit 65bf9e0c86
15 changed files with 338 additions and 23 deletions

View file

@ -1,21 +1,34 @@
extends Node
@onready var scenes = $scenes
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
loadGrid()
loadStartMenu()
func _physics_process(delta: float) -> void:
if get_children() != []:
if GLOBAL.lost and get_child(0).name == "Grid":
if scenes.get_children() != []:
if GLOBAL.lost and scenes.get_child(0).name == "Grid":
scoreOverview()
func loadGrid():
if $ScoreOverview != null:
$ScoreOverview.queue_free()
add_child(load("res://scenes/Grid/grid.tscn").instantiate())
$Grid.toggleButton()
if $scenes/ScoreOverview != null:
$scenes/ScoreOverview.queue_free()
if $scenes/StartMenu != null:
$scenes/StartMenu.queue_free()
scenes.add_child(load("res://scenes/Grid/grid.tscn").instantiate())
$scenes/Grid.toggleButton()
func scoreOverview():
if $Grid != null:
$Grid.queue_free()
add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())
if $scenes/Grid != null:
$scenes/Grid.queue_free()
if $scenes/StartMenu != null:
$scenes/StartMenu.queue_free()
scenes.add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())
func loadStartMenu():
if $scenes/ScoreOverview != null:
$scenes/ScoreOverview.queue_free()
if $scenes/Grid != null:
$scenes/Grid.queue_free()
scenes.add_child(load("res://scenes/Menu/start_menu.tscn").instantiate())