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>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user