Files
Brachistochrone/Scenes/Scripts/main_menu.gd
T
scorpion21211-cmd 72ca74c67f Initial commit
2026-10-03 23:29:41 -04:00

31 lines
853 B
GDScript

extends Control
@onready var new_game_button: Button = $CenterRoot/MenuColumn/NewGameButton
@onready var continue_button: Button = $CenterRoot/MenuColumn/ContinueButton
@onready var quit_button: Button = $CenterRoot/MenuColumn/QuitButton
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
if new_game_button:
new_game_button.pressed.connect(_on_new_game)
if continue_button:
continue_button.pressed.connect(_on_continue)
if quit_button:
quit_button.pressed.connect(_on_quit)
if continue_button:
continue_button.disabled = not GameState.has_save
func _on_new_game() -> void:
get_tree().change_scene_to_file("res://Scenes/character_creation.tscn")
func _on_continue() -> void:
Engine.set_meta("load_save", true)
get_tree().change_scene_to_file("res://Scenes/main.tscn")
func _on_quit() -> void:
get_tree().quit()