Skip to content

Commit a79ef8a

Browse files
authored
Merge pull request #50 from endlessm/pong-areas
Pong areas
2 parents b129a33 + e841bc8 commit a79ef8a

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

pong_game/ball_spawn_area.tscn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://1ownc3rikn2k"]
2+
3+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tpd4f"]
4+
size = Vector2(128, 896)
5+
6+
[node name="BallSpawnArea" type="Area2D"]
7+
8+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
9+
shape = SubResource("RectangleShape2D_tpd4f")

pong_game/goal_area.tscn

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://vc7u0ljq02eh"]
2+
3+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8q7gx"]
4+
size = Vector2(128, 1080)
5+
6+
[node name="GoalArea" type="Area2D"]
7+
8+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
9+
shape = SubResource("RectangleShape2D_8q7gx")
10+
debug_color = Color(0.91772, 6.97896e-05, 0.704698, 0.42)

pong_game/pong_game.tscn

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=31 format=3 uid="uid://tf7b8c64ecc0"]
1+
[gd_scene load_steps=33 format=3 uid="uid://tf7b8c64ecc0"]
22

33
[ext_resource type="PackedScene" uid="uid://s7enbp56f256" path="res://pong_game/paddle.tscn" id="1_1k5k2"]
44
[ext_resource type="Script" path="res://pong_game/pong_game.gd" id="1_bjkc8"]
@@ -10,6 +10,8 @@
1010
[ext_resource type="Script" path="res://addons/block_code/block_script_data/block_script_data.gd" id="7_uuuue"]
1111
[ext_resource type="PackedScene" uid="uid://bis7afjjuwypq" path="res://pong_game/hud.tscn" id="8_yg457"]
1212
[ext_resource type="PackedScene" uid="uid://c7l70grmkauij" path="res://pong_game/ball.tscn" id="9_xrqll"]
13+
[ext_resource type="PackedScene" uid="uid://1ownc3rikn2k" path="res://pong_game/ball_spawn_area.tscn" id="10_5vs1t"]
14+
[ext_resource type="PackedScene" uid="uid://vc7u0ljq02eh" path="res://pong_game/goal_area.tscn" id="12_nqmxu"]
1315

1416
[sub_resource type="Resource" id="Resource_535fl"]
1517
script = ExtResource("5_wr38c")
@@ -152,25 +154,34 @@ script = ExtResource("1_bjkc8")
152154

153155
[node name="PaddleLeft" parent="." instance=ExtResource("1_1k5k2")]
154156
modulate = Color(0.511, 0.362, 0.972, 1)
155-
position = Vector2(64, 576)
157+
position = Vector2(64, 544)
156158

157159
[node name="BlockCode" type="Node" parent="PaddleLeft"]
158160
script = ExtResource("3_6jaq8")
159161
bsd = SubResource("Resource_t7nl4")
160162

161163
[node name="PaddleRight" parent="." instance=ExtResource("1_1k5k2")]
162164
modulate = Color(0.511, 0.362, 0.972, 1)
163-
position = Vector2(1856, 576)
165+
position = Vector2(1856, 544)
164166

165167
[node name="BlockCode" type="Node" parent="PaddleRight"]
166168
script = ExtResource("3_6jaq8")
167169
bsd = SubResource("Resource_52r02")
168170

169171
[node name="Ball" parent="." instance=ExtResource("9_xrqll")]
170172
modulate = Color(0.511, 0.362, 0.972, 1)
171-
position = Vector2(960, 576)
173+
position = Vector2(960, 544)
172174
linear_velocity = Vector2(353.553, 353.553)
173175

176+
[node name="BallSpawnArea" parent="." groups=["ball_spawn_area"] instance=ExtResource("10_5vs1t")]
177+
position = Vector2(960, 544)
178+
179+
[node name="GoalAreaLeft" parent="." groups=["goal", "goal_left"] instance=ExtResource("12_nqmxu")]
180+
position = Vector2(-64, 544)
181+
182+
[node name="GoalAreaRight" parent="." groups=["goal", "goal_right"] instance=ExtResource("12_nqmxu")]
183+
position = Vector2(1984, 544)
184+
174185
[node name="HUD" parent="." instance=ExtResource("8_yg457")]
175186

176187
[node name="BlockCode" type="Node" parent="."]

0 commit comments

Comments
 (0)