Skip to content

Commit 70aeef9

Browse files
committed
Add win screen with completion time to all levels
Fixes #144 > New Feature: Levels now display completion time when cleared
1 parent 37f4937 commit 70aeef9

File tree

7 files changed

+371
-34
lines changed

7 files changed

+371
-34
lines changed

Scenes/Levels/Level1.tscn

+114-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=14 format=2]
1+
[gd_scene load_steps=21 format=2]
22

33
[ext_resource path="res://Scripts/Pause.gd" type="Script" id=1]
44
[ext_resource path="res://Scenes/SceneTransitionRect.tscn" type="PackedScene" id=2]
@@ -11,12 +11,28 @@
1111
[ext_resource path="res://Assets/Tileset.tres" type="TileSet" id=9]
1212
[ext_resource path="res://Scenes/Interactables/Activator.tscn" type="PackedScene" id=10]
1313
[ext_resource path="res://Assets/Sprites/Interactables/LightRays.png" type="Texture" id=11]
14+
[ext_resource path="res://addons/gut/fonts/AnonymousPro-Regular.ttf" type="DynamicFontData" id=12]
15+
[ext_resource path="res://addons/gut/fonts/AnonymousPro-Bold.ttf" type="DynamicFontData" id=13]
16+
[ext_resource path="res://Scenes/LevelTimer.tscn" type="PackedScene" id=15]
17+
[ext_resource path="res://Scripts/WinScreen.gd" type="Script" id=16]
1418

15-
[sub_resource type="DynamicFont" id=1]
19+
[sub_resource type="DynamicFont" id=3]
20+
size = 110
21+
font_data = ExtResource( 13 )
22+
23+
[sub_resource type="DynamicFont" id=4]
24+
size = 75
25+
font_data = ExtResource( 12 )
26+
27+
[sub_resource type="DynamicFont" id=5]
28+
size = 55
29+
font_data = ExtResource( 12 )
30+
31+
[sub_resource type="DynamicFont" id=6]
1632
size = 48
1733
font_data = ExtResource( 8 )
1834

19-
[sub_resource type="DynamicFont" id=2]
35+
[sub_resource type="DynamicFont" id=7]
2036
size = 30
2137
font_data = ExtResource( 7 )
2238

@@ -171,10 +187,95 @@ tile_data = PoolIntArray( -1179579, 0, 65538, -1179578, 0, 65538, -1179577, 0, 6
171187

172188
[node name="LevelGoal" parent="." instance=ExtResource( 4 )]
173189
position = Vector2( 16960, -640 )
174-
sceneTransitionPath = NodePath("../CanvasLayer/SceneTransitionRect")
190+
winScreenPath = NodePath("../CanvasLayer/WinScreen")
175191

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

194+
[node name="WinScreen" type="Control" parent="CanvasLayer"]
195+
pause_mode = 2
196+
visible = false
197+
anchor_right = 1.0
198+
anchor_bottom = 1.0
199+
script = ExtResource( 16 )
200+
__meta__ = {
201+
"_edit_use_anchors_": false
202+
}
203+
pausePath = NodePath("../Pause")
204+
205+
[node name="WinOverlay" type="ColorRect" parent="CanvasLayer/WinScreen"]
206+
anchor_right = 1.0
207+
anchor_bottom = 1.0
208+
color = Color( 0, 0, 0, 0.470588 )
209+
__meta__ = {
210+
"_edit_use_anchors_": false
211+
}
212+
213+
[node name="Label" type="Label" parent="CanvasLayer/WinScreen"]
214+
anchor_left = 0.5
215+
anchor_top = 0.5
216+
anchor_right = 0.5
217+
anchor_bottom = 0.5
218+
margin_left = -512.0
219+
margin_top = -340.0
220+
margin_right = 513.0
221+
margin_bottom = -124.0
222+
custom_fonts/font = SubResource( 3 )
223+
text = "LEVEL CLEAR"
224+
align = 1
225+
valign = 1
226+
__meta__ = {
227+
"_edit_use_anchors_": false
228+
}
229+
230+
[node name="Label2" type="Label" parent="CanvasLayer/WinScreen"]
231+
anchor_left = 0.5
232+
anchor_top = 0.5
233+
anchor_right = 0.5
234+
anchor_bottom = 0.5
235+
margin_left = -512.0
236+
margin_top = -84.0
237+
margin_right = 513.0
238+
margin_bottom = 132.0
239+
custom_fonts/font = SubResource( 4 )
240+
text = "TIME"
241+
align = 1
242+
valign = 1
243+
244+
[node name="Control" parent="CanvasLayer/WinScreen" instance=ExtResource( 15 )]
245+
pause_mode = 1
246+
margin_top = 112.0
247+
margin_bottom = 112.0
248+
249+
[node name="Restart" type="Button" parent="CanvasLayer/WinScreen"]
250+
anchor_left = 0.5
251+
anchor_top = 0.5
252+
anchor_right = 0.5
253+
anchor_bottom = 0.5
254+
margin_left = -256.0
255+
margin_top = 220.0
256+
margin_right = 256.0
257+
margin_bottom = 324.0
258+
custom_fonts/font = SubResource( 5 )
259+
text = "RESTART"
260+
__meta__ = {
261+
"_edit_use_anchors_": false
262+
}
263+
264+
[node name="Menu" type="Button" parent="CanvasLayer/WinScreen"]
265+
anchor_left = 0.5
266+
anchor_top = 0.5
267+
anchor_right = 0.5
268+
anchor_bottom = 0.5
269+
margin_left = -256.0
270+
margin_top = 348.0
271+
margin_right = 256.0
272+
margin_bottom = 452.0
273+
custom_fonts/font = SubResource( 5 )
274+
text = "MENU"
275+
__meta__ = {
276+
"_edit_use_anchors_": false
277+
}
278+
178279
[node name="Pause" type="Control" parent="CanvasLayer"]
179280
pause_mode = 2
180281
visible = false
@@ -207,14 +308,14 @@ __meta__ = {
207308
[node name="Pause" type="Label" parent="CanvasLayer/Pause/PauseOptions"]
208309
margin_right = 174.0
209310
margin_bottom = 55.0
210-
custom_fonts/font = SubResource( 1 )
311+
custom_fonts/font = SubResource( 6 )
211312
text = "Paused"
212313

213314
[node name="Resume" type="Button" parent="CanvasLayer/Pause/PauseOptions"]
214315
margin_top = 59.0
215316
margin_right = 174.0
216317
margin_bottom = 100.0
217-
custom_fonts/font = SubResource( 2 )
318+
custom_fonts/font = SubResource( 7 )
218319
text = "Resume"
219320
flat = true
220321
align = 0
@@ -223,7 +324,7 @@ align = 0
223324
margin_top = 104.0
224325
margin_right = 174.0
225326
margin_bottom = 145.0
226-
custom_fonts/font = SubResource( 2 )
327+
custom_fonts/font = SubResource( 7 )
227328
text = "Menu"
228329
flat = true
229330
align = 0
@@ -232,7 +333,7 @@ align = 0
232333
margin_top = 149.0
233334
margin_right = 174.0
234335
margin_bottom = 190.0
235-
custom_fonts/font = SubResource( 2 )
336+
custom_fonts/font = SubResource( 7 )
236337
text = "Restart"
237338
flat = true
238339
align = 0
@@ -241,7 +342,7 @@ align = 0
241342
margin_top = 194.0
242343
margin_right = 174.0
243344
margin_bottom = 235.0
244-
custom_fonts/font = SubResource( 2 )
345+
custom_fonts/font = SubResource( 7 )
245346
text = "Exit"
246347
flat = true
247348
align = 0
@@ -255,7 +356,11 @@ margin_right = -253.11
255356
margin_bottom = -149.68
256357
rect_scale = Vector2( 12.5768, 7.37932 )
257358

359+
[connection signal="pressed" from="CanvasLayer/WinScreen/Restart" to="CanvasLayer/WinScreen" method="_on_Restart_pressed"]
360+
[connection signal="pressed" from="CanvasLayer/WinScreen/Menu" to="CanvasLayer/WinScreen" method="_on_Menu_pressed"]
258361
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Resume" to="CanvasLayer/Pause" method="_on_Resume_pressed"]
259362
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Menu" to="CanvasLayer/Pause" method="_on_Menu_pressed"]
260363
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Restart" to="CanvasLayer/Pause" method="_on_Restart_pressed"]
261364
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Exit" to="CanvasLayer/Pause" method="_on_Exit_pressed"]
365+
366+
[editable path="CanvasLayer/WinScreen/Control"]

Scenes/Levels/Level2.tscn

+111-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=16 format=2]
1+
[gd_scene load_steps=23 format=2]
22

33
[ext_resource path="res://Scripts/Pause.gd" type="Script" id=1]
44
[ext_resource path="res://Scenes/SceneTransitionRect.tscn" type="PackedScene" id=2]
@@ -13,12 +13,28 @@
1313
[ext_resource path="res://Scenes/Enemy/RightCamera.tscn" type="PackedScene" id=11]
1414
[ext_resource path="res://Scenes/Interactables/ReceiverDoor.tscn" type="PackedScene" id=12]
1515
[ext_resource path="res://Assets/Sprites/Interactables/LightRays.png" type="Texture" id=13]
16+
[ext_resource path="res://Scripts/WinScreen.gd" type="Script" id=14]
17+
[ext_resource path="res://Scenes/LevelTimer.tscn" type="PackedScene" id=15]
18+
[ext_resource path="res://addons/gut/fonts/AnonymousPro-Regular.ttf" type="DynamicFontData" id=16]
19+
[ext_resource path="res://addons/gut/fonts/AnonymousPro-Bold.ttf" type="DynamicFontData" id=17]
1620

1721
[sub_resource type="DynamicFont" id=1]
22+
size = 110
23+
font_data = ExtResource( 17 )
24+
25+
[sub_resource type="DynamicFont" id=2]
26+
size = 75
27+
font_data = ExtResource( 16 )
28+
29+
[sub_resource type="DynamicFont" id=6]
30+
size = 55
31+
font_data = ExtResource( 16 )
32+
33+
[sub_resource type="DynamicFont" id=4]
1834
size = 48
1935
font_data = ExtResource( 8 )
2036

21-
[sub_resource type="DynamicFont" id=2]
37+
[sub_resource type="DynamicFont" id=5]
2238
size = 30
2339
font_data = ExtResource( 7 )
2440

@@ -234,10 +250,95 @@ texture = ExtResource( 13 )
234250

235251
[node name="LevelGoal" parent="." instance=ExtResource( 4 )]
236252
position = Vector2( 9472, -512 )
237-
sceneTransitionPath = NodePath("../CanvasLayer/SceneTransitionRect")
253+
winScreenPath = NodePath("../CanvasLayer/WinScreen")
238254

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

257+
[node name="WinScreen" type="Control" parent="CanvasLayer"]
258+
pause_mode = 2
259+
visible = false
260+
anchor_right = 1.0
261+
anchor_bottom = 1.0
262+
script = ExtResource( 14 )
263+
__meta__ = {
264+
"_edit_use_anchors_": false
265+
}
266+
pausePath = NodePath("../Pause")
267+
268+
[node name="WinOverlay" type="ColorRect" parent="CanvasLayer/WinScreen"]
269+
anchor_right = 1.0
270+
anchor_bottom = 1.0
271+
color = Color( 0, 0, 0, 0.470588 )
272+
__meta__ = {
273+
"_edit_use_anchors_": false
274+
}
275+
276+
[node name="Label" type="Label" parent="CanvasLayer/WinScreen"]
277+
anchor_left = 0.5
278+
anchor_top = 0.5
279+
anchor_right = 0.5
280+
anchor_bottom = 0.5
281+
margin_left = -512.0
282+
margin_top = -340.0
283+
margin_right = 513.0
284+
margin_bottom = -124.0
285+
custom_fonts/font = SubResource( 1 )
286+
text = "LEVEL CLEAR"
287+
align = 1
288+
valign = 1
289+
__meta__ = {
290+
"_edit_use_anchors_": false
291+
}
292+
293+
[node name="Label2" type="Label" parent="CanvasLayer/WinScreen"]
294+
anchor_left = 0.5
295+
anchor_top = 0.5
296+
anchor_right = 0.5
297+
anchor_bottom = 0.5
298+
margin_left = -512.0
299+
margin_top = -84.0
300+
margin_right = 513.0
301+
margin_bottom = 132.0
302+
custom_fonts/font = SubResource( 2 )
303+
text = "TIME"
304+
align = 1
305+
valign = 1
306+
307+
[node name="Control" parent="CanvasLayer/WinScreen" instance=ExtResource( 15 )]
308+
pause_mode = 1
309+
margin_top = 112.0
310+
margin_bottom = 112.0
311+
312+
[node name="Menu" type="Button" parent="CanvasLayer/WinScreen"]
313+
anchor_left = 0.5
314+
anchor_top = 0.5
315+
anchor_right = 0.5
316+
anchor_bottom = 0.5
317+
margin_left = -256.0
318+
margin_top = 348.0
319+
margin_right = 256.0
320+
margin_bottom = 452.0
321+
custom_fonts/font = SubResource( 6 )
322+
text = "MENU"
323+
__meta__ = {
324+
"_edit_use_anchors_": false
325+
}
326+
327+
[node name="Restart" type="Button" parent="CanvasLayer/WinScreen"]
328+
anchor_left = 0.5
329+
anchor_top = 0.5
330+
anchor_right = 0.5
331+
anchor_bottom = 0.5
332+
margin_left = -256.0
333+
margin_top = 220.0
334+
margin_right = 256.0
335+
margin_bottom = 324.0
336+
custom_fonts/font = SubResource( 6 )
337+
text = "RESTART"
338+
__meta__ = {
339+
"_edit_use_anchors_": false
340+
}
341+
241342
[node name="Pause" type="Control" parent="CanvasLayer"]
242343
pause_mode = 2
243344
visible = false
@@ -270,14 +371,14 @@ __meta__ = {
270371
[node name="Pause" type="Label" parent="CanvasLayer/Pause/PauseOptions"]
271372
margin_right = 174.0
272373
margin_bottom = 55.0
273-
custom_fonts/font = SubResource( 1 )
374+
custom_fonts/font = SubResource( 4 )
274375
text = "Paused"
275376

276377
[node name="Resume" type="Button" parent="CanvasLayer/Pause/PauseOptions"]
277378
margin_top = 59.0
278379
margin_right = 174.0
279380
margin_bottom = 100.0
280-
custom_fonts/font = SubResource( 2 )
381+
custom_fonts/font = SubResource( 5 )
281382
text = "Resume"
282383
flat = true
283384
align = 0
@@ -286,7 +387,7 @@ align = 0
286387
margin_top = 104.0
287388
margin_right = 174.0
288389
margin_bottom = 145.0
289-
custom_fonts/font = SubResource( 2 )
390+
custom_fonts/font = SubResource( 5 )
290391
text = "Menu"
291392
flat = true
292393
align = 0
@@ -295,7 +396,7 @@ align = 0
295396
margin_top = 149.0
296397
margin_right = 174.0
297398
margin_bottom = 190.0
298-
custom_fonts/font = SubResource( 2 )
399+
custom_fonts/font = SubResource( 5 )
299400
text = "Restart"
300401
flat = true
301402
align = 0
@@ -304,7 +405,7 @@ align = 0
304405
margin_top = 194.0
305406
margin_right = 174.0
306407
margin_bottom = 235.0
307-
custom_fonts/font = SubResource( 2 )
408+
custom_fonts/font = SubResource( 5 )
308409
text = "Exit"
309410
flat = true
310411
align = 0
@@ -318,6 +419,8 @@ margin_right = -253.11
318419
margin_bottom = -149.68
319420
rect_scale = Vector2( 12.5768, 7.37932 )
320421

422+
[connection signal="pressed" from="CanvasLayer/WinScreen/Menu" to="CanvasLayer/WinScreen" method="_on_Menu_pressed"]
423+
[connection signal="pressed" from="CanvasLayer/WinScreen/Restart" to="CanvasLayer/WinScreen" method="_on_Restart_pressed"]
321424
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Resume" to="CanvasLayer/Pause" method="_on_Resume_pressed"]
322425
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Menu" to="CanvasLayer/Pause" method="_on_Menu_pressed"]
323426
[connection signal="pressed" from="CanvasLayer/Pause/PauseOptions/Restart" to="CanvasLayer/Pause" method="_on_Restart_pressed"]

0 commit comments

Comments
 (0)