StormyExtraction/scenes/main/main.gd
2024-09-15 00:04:31 +02:00

26 lines
622 B
GDScript

extends Node
func _ready() -> void:
loadStartMenu()
func _process(delta: float) -> void:
if G.extracted and get_child(0).name != "EndScreen":
loadEndScren()
func loadGame():
G.resetValues()
for i in get_children():
i.queue_free()
add_child(load("res://scenes/game/mainGame/main_game.tscn").instantiate())
func loadEndScren():
for i in get_children():
i.queue_free()
add_child(load("res://scenes/menu/endScreen/end_screen.tscn").instantiate())
func loadStartMenu():
G.resetValues()
for i in get_children():
i.queue_free()
add_child(load("res://scenes/menu/startMenu/start_menu.tscn").instantiate())