demo-game/scripts/config.gd
simon 70e66f4d60 Adapt game clients to the unified WebSocket input stream.
Replace separate accel/tap push handling with input messages, set_input_stream, and a single set_stream on port 8081.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 13:47:41 +02:00

20 lines
593 B
GDScript
Raw Permalink 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:8081/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)