Randoloot/scripts/ui/main_menu.gd

17 lines
393 B
GDScript

extends Control
const GAME_SCENE := "res://scenes/game/game.tscn"
@onready var start_button: Button = %StartButton
@onready var exit_button: Button = %ExitButton
func _ready() -> void:
start_button.pressed.connect(_start_game)
exit_button.pressed.connect(_exit_game)
func _start_game() -> void:
get_tree().change_scene_to_file(GAME_SCENE)
func _exit_game() -> void:
get_tree().quit()