-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pong.tscn
125 lines (96 loc) · 3.68 KB
/
Pong.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[gd_scene load_steps=16 format=2]
[ext_resource path="res://Assets/ball.png" type="Texture" id=1]
[ext_resource path="res://Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Assets/wall.png" type="Texture" id=3]
[ext_resource path="res://Assets/player2-paddle.png" type="Texture" id=4]
[ext_resource path="res://Scripts/P2Score.cs" type="Script" id=5]
[ext_resource path="res://Scripts/P1Score.cs" type="Script" id=6]
[ext_resource path="res://Scripts/Pong.cs" type="Script" id=7]
[ext_resource path="res://Scripts/Ball.cs" type="Script" id=8]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 450, 15 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 450, 15 )
[sub_resource type="PhysicsMaterial" id=3]
friction = 0.0
bounce = 1.0
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 5, 5 )
[sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 26.794, 283.07 )
[sub_resource type="DynamicFontData" id=6]
font_path = "res://Assets/consolas/Consolas.ttf"
[sub_resource type="DynamicFont" id=7]
size = 50
font_data = SubResource( 6 )
[node name="2D Scene" type="Node2D"]
script = ExtResource( 7 )
[node name="Camera2D" type="Camera2D" parent="."]
current = true
[node name="TopWall" type="StaticBody2D" parent="."]
position = Vector2( 0, -275 )
scale = Vector2( 1, 0.5 )
[node name="TopWall" type="Sprite" parent="TopWall"]
texture = ExtResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="TopWall"]
shape = SubResource( 1 )
[node name="BottomWall" type="StaticBody2D" parent="."]
position = Vector2( 0, 275 )
scale = Vector2( 1, 0.5 )
[node name="BottomWall_Sprite" type="Sprite" parent="BottomWall"]
texture = ExtResource( 3 )
[node name="BottomWall_CollisionShape" type="CollisionShape2D" parent="BottomWall"]
shape = SubResource( 2 )
[node name="Player2" parent="." instance=ExtResource( 2 )]
position = Vector2( 440, 0 )
key_up = "p2_move_up"
key_down = "p2_move_down"
[node name="PlayerSprite" parent="Player2" index="0"]
texture = ExtResource( 4 )
[node name="Player1" parent="." instance=ExtResource( 2 )]
[node name="Ball" type="RigidBody2D" parent="."]
position = Vector2( 0, -1.93872 )
physics_material_override = SubResource( 3 )
gravity_scale = 0.0
linear_damp = 0.0
angular_damp = 0.0
script = ExtResource( 8 )
[node name="BallSprite" type="Sprite" parent="Ball"]
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ball"]
shape = SubResource( 4 )
[node name="P2Goal" type="Area2D" parent="."]
position = Vector2( 479.291, 1.12247 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="P2Goal"]
shape = SubResource( 5 )
[node name="P1Goal" type="Area2D" parent="."]
position = Vector2( -479.316, -0.659332 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="P1Goal"]
shape = SubResource( 5 )
[node name="P2Score" type="RichTextLabel" parent="."]
margin_left = 32.0
margin_top = -24.0
margin_right = 131.0
margin_bottom = 32.0
custom_fonts/normal_font = SubResource( 7 )
text = "0"
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="P1Score" type="RichTextLabel" parent="."]
margin_left = -80.6942
margin_top = -22.8775
margin_right = 0.305847
margin_bottom = 37.1225
custom_fonts/normal_font = SubResource( 7 )
text = "0"
script = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="body_entered" from="P2Goal" to="." method="_onP2GoalEntered"]
[connection signal="body_entered" from="P2Goal" to="P1Score" method="_OnP2GoalEntered"]
[connection signal="body_entered" from="P1Goal" to="." method="_OnP1GoalEntered"]
[connection signal="body_entered" from="P1Goal" to="P2Score" method="_OnP1GoalEntered"]
[editable path="Player2"]