2026-11-08 20:54:04 -06:00
|
|
|
extends Control
|
|
|
|
|
# Quick placeholder title screen. Start goes straight to the test level for now.
|
|
|
|
|
|
|
|
|
|
const FIRST_LEVEL = "res://Levels/test_level.tscn"
|
|
|
|
|
|
|
|
|
|
@onready var mainPanel = $CenterContainer
|
|
|
|
|
@onready var startButton = $CenterContainer/VBoxContainer/StartButton
|
2026-11-16 15:45:46 -06:00
|
|
|
@onready var mazeButton = $CenterContainer/VBoxContainer/MazeButton
|
2026-11-08 20:54:04 -06:00
|
|
|
@onready var optionsButton = $CenterContainer/VBoxContainer/OptionsButton
|
|
|
|
|
@onready var optionsMenu = $OptionsMenu
|
2026-11-16 15:45:46 -06:00
|
|
|
@onready var mazeSetupMenu = $MazeSetupMenu
|
2026-11-08 20:54:04 -06:00
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
# Keyboard focus on Start so arrow keys + Enter work right away.
|
|
|
|
|
startButton.grab_focus()
|
|
|
|
|
|
|
|
|
|
func _unhandled_input(event: InputEvent) -> void:
|
2026-11-16 15:45:46 -06:00
|
|
|
# Escape backs out of the options or maze screen.
|
2026-11-08 20:54:04 -06:00
|
|
|
if event.is_action_pressed("pause") and optionsMenu.visible:
|
|
|
|
|
optionsMenu.close()
|
|
|
|
|
get_viewport().set_input_as_handled()
|
2026-11-16 15:45:46 -06:00
|
|
|
elif event.is_action_pressed("pause") and mazeSetupMenu.visible:
|
|
|
|
|
mazeSetupMenu.close()
|
|
|
|
|
get_viewport().set_input_as_handled()
|
2026-11-08 20:54:04 -06:00
|
|
|
|
|
|
|
|
func _on_start_button_pressed() -> void:
|
|
|
|
|
Transition.change_scene(FIRST_LEVEL)
|
|
|
|
|
|
2026-11-16 15:45:46 -06:00
|
|
|
func _on_maze_button_pressed() -> void:
|
|
|
|
|
mainPanel.hide()
|
|
|
|
|
mazeSetupMenu.open()
|
|
|
|
|
|
|
|
|
|
func _on_maze_setup_menu_closed() -> void:
|
|
|
|
|
mainPanel.show()
|
|
|
|
|
mazeButton.grab_focus()
|
|
|
|
|
|
2026-11-08 20:54:04 -06:00
|
|
|
func _on_options_button_pressed() -> void:
|
|
|
|
|
mainPanel.hide()
|
|
|
|
|
optionsMenu.open()
|
|
|
|
|
|
|
|
|
|
func _on_options_menu_closed() -> void:
|
|
|
|
|
mainPanel.show()
|
|
|
|
|
optionsButton.grab_focus()
|
|
|
|
|
|
|
|
|
|
func _on_quit_button_pressed() -> void:
|
|
|
|
|
get_tree().quit()
|