demo-game/scripts/menu.gd
simon 84827c9782 Add main menu, WebSocket API demo, and multi-scene game hub.
Replace the single-entry Pong flow with a menu launcher, a per-client API demo on :8081/ws with stream controls and tap flash feedback, and bump the viewport to 1920×1080.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 21:43:44 +02:00

29 lines
973 B
GDScript

extends Control
const DEMO_SCENE := "res://scenes/demo.tscn"
const CONFIG_SCENE := "res://scenes/config.tscn"
const PONG_SCENE := "res://scenes/pong.tscn"
const COLOR_GAME_SCENE := "res://scenes/color_game.tscn"
@onready var demo_button: Button = $CenterBox/DemoButton
@onready var config_button: Button = $CenterBox/ConfigButton
@onready var pong_button: Button = $CenterBox/PongButton
@onready var color_game_button: Button = $CenterBox/ColorGameButton
@onready var exit_button: Button = $CenterBox/ExitButton
func _ready() -> void:
demo_button.pressed.connect(func(): _open_scene(DEMO_SCENE))
config_button.pressed.connect(func(): _open_scene(CONFIG_SCENE))
pong_button.pressed.connect(func(): _open_scene(PONG_SCENE))
color_game_button.pressed.connect(func(): _open_scene(COLOR_GAME_SCENE))
exit_button.pressed.connect(_exit_game)
func _open_scene(path: String) -> void:
get_tree().change_scene_to_file(path)
func _exit_game() -> void:
get_tree().quit()