-
Notifications
You must be signed in to change notification settings - Fork 7
/
pong.tscn
115 lines (85 loc) · 3.62 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
[gd_scene load_steps=15 format=2]
[ext_resource path="res://logic/paddle.gd" type="Script" id=1]
[ext_resource path="res://paddle.png" type="Texture" id=2]
[ext_resource path="res://ui/score.tscn" type="PackedScene" id=3]
[ext_resource path="res://logic/ball.gd" type="Script" id=4]
[ext_resource path="res://ball.png" type="Texture" id=5]
[ext_resource path="res://separator.png" type="Texture" id=6]
[ext_resource path="res://logic/wall.gd" type="Script" id=7]
[ext_resource path="res://logic/ceiling_floor.gd" type="Script" id=8]
[sub_resource type="Gradient" id=5]
offsets = PoolRealArray( 1.02857e-38, 1 )
colors = PoolColorArray( 1, 0.392157, 0.392157, 1, 0, 0.364706, 0.858824, 1 )
[sub_resource type="GradientTexture2D" id=6]
gradient = SubResource( 5 )
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 4, 16 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 4, 4 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 10, 200 )
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 320, 10 )
[node name="Pong" type="Node2D"]
[node name="Background" type="TextureRect" parent="."]
margin_right = 640.0
margin_bottom = 400.0
texture = SubResource( 6 )
expand = true
[node name="Interface" parent="Background" instance=ExtResource( 3 )]
[node name="Left" type="Area2D" parent="."]
position = Vector2( 65, 200 )
scale = Vector2( 1, 1.5 )
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="Left"]
texture = ExtResource( 2 )
[node name="Collision" type="CollisionShape2D" parent="Left"]
shape = SubResource( 1 )
[node name="Right" type="Area2D" parent="."]
position = Vector2( 565, 200 )
scale = Vector2( 1, 1.5 )
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="Right"]
texture = ExtResource( 2 )
[node name="Collision" type="CollisionShape2D" parent="Right"]
shape = SubResource( 1 )
[node name="Ball" type="Area2D" parent="."]
position = Vector2( 320, 200 )
script = ExtResource( 4 )
[node name="Sprite" type="Sprite" parent="Ball"]
texture = ExtResource( 5 )
[node name="Collision" type="CollisionShape2D" parent="Ball"]
shape = SubResource( 2 )
[node name="Separator" type="Sprite" parent="."]
position = Vector2( 320, 200 )
texture = ExtResource( 6 )
[node name="LeftWall" type="Area2D" parent="."]
position = Vector2( -10, 200 )
script = ExtResource( 7 )
[node name="Collision" type="CollisionShape2D" parent="LeftWall"]
shape = SubResource( 3 )
[node name="RightWall" type="Area2D" parent="."]
position = Vector2( 650, 200 )
script = ExtResource( 7 )
[node name="Collision" type="CollisionShape2D" parent="RightWall"]
shape = SubResource( 3 )
[node name="Ceiling" type="Area2D" parent="."]
position = Vector2( 320, -10 )
script = ExtResource( 8 )
[node name="Collision" type="CollisionShape2D" parent="Ceiling"]
shape = SubResource( 4 )
[node name="Floor" type="Area2D" parent="."]
position = Vector2( 320, 410 )
script = ExtResource( 8 )
_bounce_direction = -1
[node name="Collision" type="CollisionShape2D" parent="Floor"]
shape = SubResource( 4 )
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2( 320, 200 )
current = true
[connection signal="area_entered" from="Left" to="Left" method="_on_area_entered"]
[connection signal="area_entered" from="Right" to="Right" method="_on_area_entered"]
[connection signal="area_entered" from="LeftWall" to="LeftWall" method="_on_wall_area_entered"]
[connection signal="area_entered" from="RightWall" to="RightWall" method="_on_wall_area_entered"]
[connection signal="area_entered" from="Ceiling" to="Ceiling" method="_on_area_entered"]
[connection signal="area_entered" from="Floor" to="Floor" method="_on_area_entered"]