wild jam prototype
This commit is contained in:
19
scripts/main_menu.gd
Normal file
19
scripts/main_menu.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Control
|
||||
class_name MainMenu
|
||||
|
||||
var mazes = ["res://scene/maze_1.tscn"]
|
||||
|
||||
@onready var win_loss_label: Label = $HBoxContainer/MarginContainer/VBoxContainer/WinLossLabel
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file(mazes.pick_random())
|
||||
|
||||
func _ready() -> void:
|
||||
if not HasWon.inital_load:
|
||||
var won_text = ["YOU WON!!!" if HasWon.won else "You Lost..."]
|
||||
won_text.append_array(HasWon.escaped.values())
|
||||
win_loss_label.text = "%s Escaped counts: %s Red, %s Green, %s Blue" % won_text
|
||||
Reference in New Issue
Block a user