demo-game/scenes/main.tscn
simon bc25226a31 Initial commit: Godot Pong game with WebSocket accelerometer control.
Includes platform steering via calibrated accel axes, ball physics,
calibration overlay with axis detection, and runtime tuning sliders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 21:52:35 +02:00

150 lines
3.9 KiB
Plaintext

[gd_scene load_steps=4 format=3 uid="uid://bmain2dscene01"]
[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"]
[node name="Main" type="Node2D"]
script = ExtResource("1_main")
[node name="BgLayer" type="CanvasLayer" parent="."]
layer = -10
[node name="Background" type="ColorRect" parent="BgLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0.08, 0.09, 0.14, 1)
[node name="Platform" type="Polygon2D" parent="."]
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="."]
position = Vector2(576, 320)
script = ExtResource("2_ball")
[node name="UiLayer" type="CanvasLayer" parent="."]
[node name="StatusLabel" type="Label" parent="UiLayer"]
offset_left = 16.0
offset_top = 12.0
offset_right = 560.0
offset_bottom = 40.0
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"]
offset_left = 16.0
offset_top = 48.0
offset_right = 420.0
offset_bottom = 148.0
[node name="ThresholdCaption" type="Label" parent="UiLayer/ThresholdPanel"]
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"]
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"]
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"]
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"]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -320.0
offset_top = -72.0
offset_right = -16.0
offset_bottom = -20.0
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: —"
[node name="RecalibButton" type="Button" parent="UiLayer"]
visible = false
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -220.0
offset_top = 12.0
offset_right = -16.0
offset_bottom = 44.0
grow_horizontal = 0
text = "Kalibrierung neu starten"
[node name="CalibrationOverlay" type="Control" parent="UiLayer"]
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"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -360.0
offset_top = 80.0
offset_right = 360.0
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
horizontal_alignment = 1
autowrap_mode = 3
text = "Kalibrierung"
[node name="StartButton" type="Button" parent="UiLayer/CalibrationOverlay"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -140.0
offset_top = -120.0
offset_right = 140.0
offset_bottom = -72.0
grow_horizontal = 2
text = "Kalibrierung starten"