ChronoChamber/game_manager.gd

24 lines
623 B
GDScript

extends Node
@export var levels : Array[LevelRes]
@export var menu_scene_path : String
@export var sandbox_scene_path : String
var current_level = 0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func load_next_level():
if current_level+1 < levels.size():
get_tree().change_scene_to_file(levels[current_level+1].level_path)
current_level += 1
else:
print("end of game reached!")
get_tree().change_scene_to_file(menu_scene_path)
pass