Texpand/scenes/Main/main.gd
2024-08-20 14:50:39 +02:00

21 lines
559 B
GDScript

extends Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
loadGrid()
func _physics_process(delta: float) -> void:
if get_children() != []:
if GLOBAL.lost and 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()
func scoreOverview():
if $Grid != null:
$Grid.queue_free()
add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())