22 lines
480 B
GDScript
22 lines
480 B
GDScript
extends Node
|
|
|
|
@export var levels : Array[PackedScene]
|
|
|
|
var current_index = 0
|
|
|
|
func next():
|
|
if (current_index == 0):
|
|
print ("Cannot skip! Must load from objective!")
|
|
return
|
|
print ("Loading next...")
|
|
current_index += 1
|
|
get_tree().change_scene_to_packed(levels[current_index])
|
|
|
|
func redo():
|
|
print ("Reloading current...")
|
|
get_tree().change_scene_to_packed(levels[current_index])
|
|
|
|
func arbitrary(index):
|
|
current_index = index
|
|
print("Loading arbitrary level... @" + index)
|