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:
2026-05-29 21:43:44 +02:00
co-authored by Cursor
parent 9107dea6ff
commit 84827c9782
20 changed files with 1503 additions and 29 deletions
+24 -27
View File
@@ -1,16 +1,16 @@
[gd_scene load_steps=4 format=3 uid="uid://bmain2dscene01"]
[gd_scene format=3 uid="uid://cjs5bms5o6763"]
[ext_resource type="Script" path="res://scripts/main.gd" id="1_main"]
[ext_resource type="Script" path="res://scripts/ball.gd" id="2_ball"]
[ext_resource type="Script" path="res://scripts/calibration_overlay.gd" id="3_calib"]
[ext_resource type="Script" uid="uid://bnvlevjo1fp48" path="res://scripts/ball.gd" id="2_ball"]
[ext_resource type="Script" uid="uid://crbm1833myr5l" path="res://scripts/calibration_overlay.gd" id="3_calib"]
[node name="Main" type="Node2D"]
[node name="Main" type="Node2D" unique_id=474005048]
script = ExtResource("1_main")
[node name="BgLayer" type="CanvasLayer" parent="."]
[node name="BgLayer" type="CanvasLayer" parent="." unique_id=895115848]
layer = -10
[node name="Background" type="ColorRect" parent="BgLayer"]
[node name="Background" type="ColorRect" parent="BgLayer" unique_id=808294717]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@@ -19,18 +19,18 @@ grow_vertical = 2
mouse_filter = 2
color = Color(0.08, 0.09, 0.14, 1)
[node name="Platform" type="Polygon2D" parent="."]
[node name="Platform" type="Polygon2D" parent="." unique_id=1966405851]
position = Vector2(576, 600)
color = Color(0.25, 0.72, 0.95, 1)
polygon = PackedVector2Array(-80, -12, 80, -12, 80, 12, -80, -12)
position = Vector2(576, 600)
[node name="Ball" type="Node2D" parent="."]
[node name="Ball" type="Node2D" parent="." unique_id=1211114968]
position = Vector2(576, 320)
script = ExtResource("2_ball")
[node name="UiLayer" type="CanvasLayer" parent="."]
[node name="UiLayer" type="CanvasLayer" parent="." unique_id=635198279]
[node name="StatusLabel" type="Label" parent="UiLayer"]
[node name="StatusLabel" type="Label" parent="UiLayer" unique_id=601884942]
offset_left = 16.0
offset_top = 12.0
offset_right = 560.0
@@ -39,47 +39,44 @@ theme_override_colors/font_color = Color(0.75, 0.8, 0.9, 1)
theme_override_font_sizes/font_size = 14
text = "Starting…"
[node name="ThresholdPanel" type="VBoxContainer" parent="UiLayer"]
[node name="ThresholdPanel" type="VBoxContainer" parent="UiLayer" unique_id=1490838898]
offset_left = 16.0
offset_top = 48.0
offset_right = 420.0
offset_bottom = 148.0
[node name="ThresholdCaption" type="Label" parent="UiLayer/ThresholdPanel"]
[node name="ThresholdCaption" type="Label" parent="UiLayer/ThresholdPanel" unique_id=1245613915]
layout_mode = 2
theme_override_colors/font_color = Color(0.75, 0.8, 0.9, 1)
theme_override_font_sizes/font_size = 14
text = "Schwellwert: 3000"
[node name="ThresholdSlider" type="HSlider" parent="UiLayer/ThresholdPanel"]
[node name="ThresholdSlider" type="HSlider" parent="UiLayer/ThresholdPanel" unique_id=1874311831]
custom_minimum_size = Vector2(380, 0)
layout_mode = 2
size_flags_horizontal = 3
min_value = 0.0
max_value = 15000.0
step = 50.0
value = 3000.0
tick_count = 16
ticks_on_borders = true
[node name="SensitivityCaption" type="Label" parent="UiLayer/ThresholdPanel"]
[node name="SensitivityCaption" type="Label" parent="UiLayer/ThresholdPanel" unique_id=1083787312]
layout_mode = 2
theme_override_colors/font_color = Color(0.75, 0.8, 0.9, 1)
theme_override_font_sizes/font_size = 14
text = "Bewegungsstärke: 6 %"
[node name="SensitivitySlider" type="HSlider" parent="UiLayer/ThresholdPanel"]
[node name="SensitivitySlider" type="HSlider" parent="UiLayer/ThresholdPanel" unique_id=1497316063]
custom_minimum_size = Vector2(380, 0)
layout_mode = 2
size_flags_horizontal = 3
min_value = 1.0
max_value = 100.0
step = 1.0
value = 6.0
tick_count = 11
ticks_on_borders = true
[node name="AccelLabel" type="Label" parent="UiLayer"]
[node name="AccelLabel" type="Label" parent="UiLayer" unique_id=1538579724]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
@@ -93,10 +90,10 @@ grow_horizontal = 0
grow_vertical = 0
theme_override_colors/font_color = Color(0.9, 0.92, 0.55, 1)
theme_override_font_sizes/font_size = 16
horizontal_alignment = 2
text = "x: — y: — z: —"
horizontal_alignment = 2
[node name="RecalibButton" type="Button" parent="UiLayer"]
[node name="RecalibButton" type="Button" parent="UiLayer" unique_id=1145373245]
visible = false
anchors_preset = 1
anchor_left = 1.0
@@ -108,17 +105,16 @@ offset_bottom = 44.0
grow_horizontal = 0
text = "Kalibrierung neu starten"
[node name="CalibrationOverlay" type="Control" parent="UiLayer"]
[node name="CalibrationOverlay" type="Control" parent="UiLayer" unique_id=2105464363]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 0
script = ExtResource("3_calib")
[node name="HintLabel" type="Label" parent="UiLayer/CalibrationOverlay"]
[node name="HintLabel" type="Label" parent="UiLayer/CalibrationOverlay" unique_id=2126154488]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
@@ -130,11 +126,11 @@ offset_bottom = 140.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.9, 0.92, 0.98, 1)
theme_override_font_sizes/font_size = 20
text = "Kalibrierung"
horizontal_alignment = 1
autowrap_mode = 3
text = "Kalibrierung"
[node name="StartButton" type="Button" parent="UiLayer/CalibrationOverlay"]
[node name="StartButton" type="Button" parent="UiLayer/CalibrationOverlay" unique_id=468536630]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
@@ -146,4 +142,5 @@ offset_top = -120.0
offset_right = 140.0
offset_bottom = -72.0
grow_horizontal = 2
grow_vertical = 0
text = "Kalibrierung starten"