final commit :)
This commit is contained in:
@@ -5,15 +5,34 @@ var levels: Dictionary = {
|
||||
"test2": "uid://b1jbl6gvlvpvy",
|
||||
"1": "uid://cnq5ir1kfkqan",
|
||||
"2": "uid://dd88vrckuqggu",
|
||||
"3": "uid://dk46prqr68bh0"
|
||||
"3": "uid://dk46prqr68bh0",
|
||||
"4": "uid://uo8cy276f3cp",
|
||||
"5": "uid://b2j2gwes24th2",
|
||||
"6": "uid://iw6327x7cecu",
|
||||
"END": "uid://dcrnnrnvbqmq0"
|
||||
}
|
||||
|
||||
|
||||
|
||||
func reset_level() -> void:
|
||||
await get_tree().create_timer(1).timeout
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("RESTART"):
|
||||
reset_level()
|
||||
if OS.has_feature("debug"):
|
||||
if Input.is_action_just_pressed("1"):
|
||||
change_level("1")
|
||||
if Input.is_action_just_pressed("2"):
|
||||
change_level("2")
|
||||
if Input.is_action_just_pressed("3"):
|
||||
change_level("3")
|
||||
if Input.is_action_just_pressed("4"):
|
||||
change_level("4")
|
||||
if Input.is_action_just_pressed("5"):
|
||||
change_level("5")
|
||||
if Input.is_action_just_pressed("6"):
|
||||
change_level("6")
|
||||
|
||||
func change_level(levelName: String) -> void:
|
||||
print(levels[levelName])
|
||||
get_tree().change_scene_to_file(levels[levelName])
|
||||
|
||||
Reference in New Issue
Block a user