Frontier-of-Hell/scripts/ui/victory.gd

18 lines
461 B
GDScript3
Raw Normal View History

2023-10-19 15:20:13 +02:00
extends Control
var next_stage: int = 0
func set_next_stage(value: int):
if value != 0:
next_stage = value
else:
$Panel/MarginContainer/VBoxContainer/NextStage.text = "Main Menu"
func _on_next_stage_pressed():
get_tree().paused = false
if next_stage != 0:
get_tree().change_scene_to_file("res://scenes/stages/stage_{stage_id}.tscn".format({"stage_id": str(next_stage)}))
else:
get_tree().change_scene_to_file("res://scenes/ui/main_menu.tscn")