Profile

pong-together

← Back to repositories | View on GitHub

Pong, but wireless multiplayer.

GDScript 1 0 Updated: 12/15/2025

title.tscn

[gd_scene load_steps=16 format=3 uid="uid://druvdlfuby0qh"]

[ext_resource type="Script" uid="uid://duj8k5ui3jnd" path="res://title.gd" id="1_y7k74"]
[ext_resource type="FontFile" uid="uid://bajl5oh84qbn5" path="res://pong-score.ttf" id="2_3xoar"]
[ext_resource type="Script" uid="uid://6yd8aorplf7u" path="res://ceiling.gd" id="2_kpexm"]
[ext_resource type="Shader" uid="uid://1xmn6ujxctpd" path="res://new_shader.gdshader" id="4_3xoar"]
[ext_resource type="Script" uid="uid://cs5xfk5yluku" path="res://animation.gd" id="5_mom7w"]
[ext_resource type="AudioStream" uid="uid://1v4j26ulkyjn" path="res://score.mp3" id="6_7lgly"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_mom7w"]
size = Vector2(816, 20)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_oyqm6"]
size = Vector2(25, 576)

[sub_resource type="ShaderMaterial" id="ShaderMaterial_mom7w"]
shader = ExtResource("4_3xoar")
shader_parameter/resolution = Vector2(500, 400)
shader_parameter/scan_line_amount = 1.0
shader_parameter/warp_amount = 0.0
shader_parameter/noise_amount = 0.2
shader_parameter/interference_amount = 0.2
shader_parameter/grille_amount = 1.0
shader_parameter/grille_size = 1.0
shader_parameter/vignette_amount = 0.6
shader_parameter/vignette_intensity = 0.4
shader_parameter/aberation_amount = 0.5
shader_parameter/roll_line_amount = 0.3
shader_parameter/roll_speed = 1.0
shader_parameter/scan_line_strength = -8.0
shader_parameter/pixel_strength = -2.0

[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_7lgly"]

[sub_resource type="Animation" id="Animation_mom7w"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/noise_amount")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.2]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/warp_amount")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_3xoar"]
resource_name = "new_animation"
length = 3.578
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/resolution")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.8, 1),
"transitions": PackedFloat32Array(0.707107, 0.68302),
"update": 0,
"values": [Vector2(0, 0), Vector2(500, 400)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/grille_size")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.633333, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [5.0, 1.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/noise_amount")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.966667, 2.6),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.3, 0.03]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/warp_amount")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.64, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [5.0, 0.1]
}

[sub_resource type="Animation" id="Animation_7lgly"]
resource_name = "new_animation_2"
length = 25.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CanvasLayer/Sprite2D:material:shader_parameter/noise_amount")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.6, 2.6, 7.93333),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [0.03, 0.2, 0.03]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_7lgly"]
_data = {
&"RESET": SubResource("Animation_mom7w"),
&"new_animation": SubResource("Animation_3xoar"),
&"new_animation_2": SubResource("Animation_7lgly")
}

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_3xoar"]
properties/0/path = NodePath("../waiting:visible")
properties/0/spawn = true
properties/0/replication_mode = 2
properties/1/path = NodePath("..:gpaused")
properties/1/spawn = true
properties/1/replication_mode = 2
properties/2/path = NodePath("../Control/Label:text")
properties/2/spawn = true
properties/2/replication_mode = 2
properties/3/path = NodePath("../Control/Label2:text")
properties/3/spawn = true
properties/3/replication_mode = 2

[node name="Node2D" type="Node2D"]
process_mode = 3
script = ExtResource("1_y7k74")

[node name="menu" type="Node2D" parent="."]

[node name="ColorRect" type="ColorRect" parent="menu"]
offset_left = -50.0
offset_top = -39.0
offset_right = 855.0
offset_bottom = 625.0
color = Color(0.254206, 0.254206, 0.254206, 1)

[node name="Button" type="Button" parent="menu"]
offset_left = 279.0
offset_top = 263.0
offset_right = 494.0
offset_bottom = 328.0
theme_override_font_sizes/font_size = 41
text = "host game"

[node name="TextEdit" type="TextEdit" parent="menu"]
offset_left = 222.0
offset_top = 457.0
offset_right = 569.0
offset_bottom = 505.0
theme_override_font_sizes/font_size = 25
placeholder_text = "Enter IP Address"

[node name="TextEdit2" type="TextEdit" parent="menu"]
offset_left = 222.0
offset_top = 502.0
offset_right = 569.0
offset_bottom = 550.0
theme_override_font_sizes/font_size = 25
text = "7777"
placeholder_text = "Enter Port Number"

[node name="TextEdit3" type="TextEdit" parent="menu"]
offset_left = 222.0
offset_top = 329.0
offset_right = 569.0
offset_bottom = 377.0
theme_override_font_sizes/font_size = 25
text = "7777"
placeholder_text = "Enter Port Number"

[node name="Button2" type="Button" parent="menu"]
offset_left = 280.0
offset_top = 386.0
offset_right = 494.0
offset_bottom = 451.0
theme_override_font_sizes/font_size = 41
text = "join game"

[node name="Label" type="Label" parent="menu"]
offset_left = 3.0
offset_top = 122.0
offset_right = 794.0
offset_bottom = 239.0
scale = Vector2(1.0036, 1.0041)
theme_override_fonts/font = ExtResource("2_3xoar")
theme_override_font_sizes/font_size = 71
text = "Pong Together"
horizontal_alignment = 1
vertical_alignment = 1

[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("uid://dst0vyi545mxx", "uid://clpdqyj07yqhf")
spawn_path = NodePath("..")

[node name="Area2D" type="Area2D" parent="."]
script = ExtResource("2_kpexm")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(398, 0)
shape = SubResource("RectangleShape2D_mom7w")

[node name="Area2D2" type="Area2D" parent="."]
position = Vector2(0, 600)
script = ExtResource("2_kpexm")
_bounce_direction = -1

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D2"]
position = Vector2(398, 0)
shape = SubResource("RectangleShape2D_mom7w")

[node name="waiting" type="Node2D" parent="."]
process_mode = 3
visible = false

[node name="ColorRect" type="ColorRect" parent="waiting"]
offset_right = 824.0
offset_bottom = 618.0
color = Color(0.192157, 0.192157, 0.192157, 0.686275)

[node name="Label" type="Label" parent="waiting"]
offset_left = 98.0
offset_top = 254.0
offset_right = 658.0
offset_bottom = 324.0
theme_override_font_sizes/font_size = 51
text = "waiting...."

[node name="Area2D3" type="Area2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D3"]
position = Vector2(805, 300)
shape = SubResource("RectangleShape2D_oyqm6")

[node name="Area2D4" type="Area2D" parent="."]
position = Vector2(-800, 0)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D4"]
position = Vector2(800, 300)
shape = SubResource("RectangleShape2D_oyqm6")

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="Sprite2D" type="Sprite2D" parent="CanvasLayer"]
material = SubResource("ShaderMaterial_mom7w")
position = Vector2(384, 298.5)
scale = Vector2(914, 653)
texture = SubResource("PlaceholderTexture2D_7lgly")

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_7lgly")
}
autoplay = "new_animation"
speed_scale = 1.205
script = ExtResource("5_mom7w")

[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
root_path = NodePath("../MultiplayerSpawner")
replication_config = SubResource("SceneReplicationConfig_3xoar")

[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="ColorRect" type="ColorRect" parent="Control"]
layout_mode = 0
offset_left = 396.0
offset_top = 13.0
offset_right = 400.0
offset_bottom = 74.0

[node name="Label" type="Label" parent="Control"]
layout_mode = 0
offset_left = 33.0
offset_top = 13.0
offset_right = 419.0
offset_bottom = 74.0
theme_override_fonts/font = ExtResource("2_3xoar")
theme_override_font_sizes/font_size = 61
text = "0"
horizontal_alignment = 2
vertical_alignment = 1

[node name="Label2" type="Label" parent="Control"]
layout_mode = 0
offset_left = 407.0
offset_top = 13.0
offset_right = 793.0
offset_bottom = 74.0
theme_override_fonts/font = ExtResource("2_3xoar")
theme_override_font_sizes/font_size = 61
text = "0"
vertical_alignment = 1

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_7lgly")
volume_db = 2.0
mix_target = 2

[connection signal="pressed" from="menu/Button" to="." method="_on_button_pressed"]
[connection signal="pressed" from="menu/Button2" to="." method="_on_button_2_pressed"]
[connection signal="area_entered" from="Area2D" to="Area2D" method="_on_area_entered"]
[connection signal="area_entered" from="Area2D2" to="Area2D2" method="_on_area_entered"]
[connection signal="area_entered" from="Area2D3" to="." method="_on_area_2d_3_area_entered"]
[connection signal="area_entered" from="Area2D4" to="." method="_on_area_2d_4_area_entered"]
[connection signal="animation_finished" from="AnimationPlayer" to="AnimationPlayer" method="_on_animation_finished"]