File size: 5,484 Bytes
c6c8030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7019bd1
c6c8030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
[gd_scene load_steps=13 format=3 uid="uid://bj8j0v5unredq"]

[ext_resource type="Script" path="res://Player.gd" id="1"]
[ext_resource type="Script" path="res://addons/godot_rl_agents/sensors/sensors_2d/RaycastSensor2D.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://c77mj86i50gub" path="res://cherry.png" id="3_25acu"]
[ext_resource type="Texture2D" uid="uid://cy4acafft8vjv" path="res://lollipopGreen.png" id="3_ty2qt"]

[sub_resource type="CircleShape2D" id="1"]
radius = 30.0

[sub_resource type="CircleShape2D" id="3"]
radius = 30.0

[sub_resource type="RectangleShape2D" id="4"]
size = Vector2(20, 720)

[sub_resource type="RectangleShape2D" id="5"]
size = Vector2(20, 720)

[sub_resource type="RectangleShape2D" id="6"]
size = Vector2(1240, 20)

[sub_resource type="RectangleShape2D" id="7"]
size = Vector2(1240, 20)

[sub_resource type="RectangleShape2D" id="8"]
size = Vector2(58.338, 286.306)

[sub_resource type="Environment" id="9"]
background_mode = 4
tonemap_mode = 3
glow_levels/1 = 1.0
glow_levels/2 = 1.0
glow_levels/3 = 0.0
glow_levels/4 = 1.0
glow_levels/5 = 0.0
glow_intensity = 0.1
glow_strength = 1.17
glow_bloom = 0.09
glow_blend_mode = 0

[node name="BallChase" type="Node2D"]

[node name="Player" type="CharacterBody2D" parent="." groups=["AGENT"]]
position = Vector2(281.728, 162.943)
script = ExtResource("1")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
shape = SubResource("1")

[node name="RaycastSensor2D" type="Node2D" parent="Player"]
script = ExtResource("2")
collide_with_areas = true

[node name="Sprite2D" type="Sprite2D" parent="Player"]
scale = Vector2(0.9, 0.9)
texture = ExtResource("3_ty2qt")

[node name="Fruit" type="Area2D" parent="."]
position = Vector2(1095.01, 578.224)
collision_layer = 2
collision_mask = 3

[node name="CollisionShape2D" type="CollisionShape2D" parent="Fruit"]
shape = SubResource("3")

[node name="Sprite2D" type="Sprite2D" parent="Fruit"]
position = Vector2(3.98999, -14.224)
scale = Vector2(1.2, 1.2)
texture = ExtResource("3_25acu")

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

[node name="LeftWall" type="Area2D" parent="Walls"]
position = Vector2(10, 360)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/LeftWall"]
shape = SubResource("4")

[node name="ColorRect" type="ColorRect" parent="Walls/LeftWall"]
offset_left = -10.0
offset_top = -360.0
offset_right = 10.0
offset_bottom = 360.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="RightWall" type="Area2D" parent="Walls"]
position = Vector2(1270, 360)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/RightWall"]
shape = SubResource("5")

[node name="ColorRect" type="ColorRect" parent="Walls/RightWall"]
offset_left = -10.0
offset_top = -360.0
offset_right = 10.0
offset_bottom = 360.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="TopWall" type="Area2D" parent="Walls"]
position = Vector2(640, 10)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/TopWall"]
shape = SubResource("6")

[node name="ColorRect" type="ColorRect" parent="Walls/TopWall"]
offset_left = -620.0
offset_top = -10.0
offset_right = 620.0
offset_bottom = 10.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="BottomWall" type="Area2D" parent="Walls"]
position = Vector2(640, 710)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/BottomWall"]
shape = SubResource("7")

[node name="ColorRect" type="ColorRect" parent="Walls/BottomWall"]
offset_left = -620.0
offset_top = -10.0
offset_right = 620.0
offset_bottom = 10.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="Obstacle4" type="Area2D" parent="Walls"]
position = Vector2(896, 328)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Obstacle4"]
shape = SubResource("8")

[node name="ColorRect" type="ColorRect" parent="Walls/Obstacle4"]
offset_left = -35.0
offset_top = -143.0
offset_right = 29.0
offset_bottom = 153.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="Obstacle5" type="Area2D" parent="Walls"]
position = Vector2(360, 328)

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Obstacle5"]
shape = SubResource("8")

[node name="ColorRect" type="ColorRect" parent="Walls/Obstacle5"]
offset_left = -35.0
offset_top = -143.0
offset_right = 29.0
offset_bottom = 153.0
color = Color(0.27451, 0.529412, 0.560784, 1)

[node name="BackGround" type="CanvasLayer" parent="."]
layer = -2

[node name="ColorRect" type="ColorRect" parent="BackGround"]
anchors_preset = -1
anchor_right = 5.954
anchor_bottom = 5.885
offset_right = 15506.9
offset_bottom = 7480.8
color = Color(0.2, 0.172549, 0.313726, 1)

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("9")

[connection signal="body_entered" from="Fruit" to="Player" method="_on_Fruit_body_entered"]
[connection signal="body_entered" from="Walls/LeftWall" to="Player" method="_on_LeftWall_body_entered"]
[connection signal="body_entered" from="Walls/RightWall" to="Player" method="_on_RightWall_body_entered"]
[connection signal="body_entered" from="Walls/TopWall" to="Player" method="_on_TopWall_body_entered"]
[connection signal="body_entered" from="Walls/BottomWall" to="Player" method="_on_BottomWall_body_entered"]
[connection signal="body_entered" from="Walls/Obstacle4" to="Player" method="_on_BottomWall_body_entered"]
[connection signal="body_entered" from="Walls/Obstacle5" to="Player" method="_on_BottomWall_body_entered"]