demo-game/scripts/config.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

20 lines
593 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends Control
const MENU_SCENE := "res://scenes/menu.tscn"
const WS_URL := "ws://localhost:9090/ws"
@onready var back_button: Button = $UiLayer/BackButton
@onready var ws_url_label: Label = $UiLayer/Panel/WSUrlLabel
@onready var viewport_label: Label = $UiLayer/Panel/ViewportLabel
func _ready() -> void:
back_button.pressed.connect(_return_to_menu)
ws_url_label.text = "WebSocket: %s" % WS_URL
var size := get_viewport_rect().size
viewport_label.text = "Viewport: %d × %d" % [int(size.x), int(size.y)]
func _return_to_menu() -> void:
get_tree().change_scene_to_file(MENU_SCENE)