20 lines
537 B
GDScript
20 lines
537 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())
|
|
|
|
func scoreOverview():
|
|
if $Grid != null:
|
|
$Grid.queue_free()
|
|
add_child(load("res://scenes/ScoreOverview/score_overview.tscn").instantiate())
|