Cleaned up the Code; reworked the Block Physics
This commit is contained in:
parent
ed9f671256
commit
9f6750b08a
48 changed files with 1237 additions and 1116 deletions
|
|
@ -20,27 +20,22 @@ func _physics_process(delta: float) -> void:
|
|||
fullscreen = false
|
||||
if scenes.get_children() != []:
|
||||
if GLOBAL.lost and scenes.get_child(0).name == "Grid":
|
||||
scoreOverview()
|
||||
loadScoreOverview()
|
||||
GLOBAL.lost = false
|
||||
|
||||
func loadGrid():
|
||||
if $scenes/ScoreOverview != null:
|
||||
$scenes/ScoreOverview.queue_free()
|
||||
if $scenes/StartMenu != null:
|
||||
$scenes/StartMenu.queue_free()
|
||||
for i in scenes.get_children():
|
||||
i.queue_free()
|
||||
scenes.add_child(load("res://scenes/Grid/grid.tscn").instantiate())
|
||||
$scenes/Grid.toggleButton()
|
||||
$scenes/Grid.startGame()
|
||||
|
||||
func scoreOverview():
|
||||
if $scenes/Grid != null:
|
||||
$scenes/Grid.queue_free()
|
||||
if $scenes/StartMenu != null:
|
||||
$scenes/StartMenu.queue_free()
|
||||
func loadScoreOverview():
|
||||
for i in scenes.get_children():
|
||||
i.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()
|
||||
for i in scenes.get_children():
|
||||
i.queue_free()
|
||||
scenes.add_child(load("res://scenes/Menu/start_menu.tscn").instantiate())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue