diff --git a/menus/game_over.gd b/menus/game_over.gd index 39eef54..9a428a9 100644 --- a/menus/game_over.gd +++ b/menus/game_over.gd @@ -2,9 +2,13 @@ extends CanvasLayer onready var retry_button = $Panel/Retry onready var exit_button = $Panel/Exit +onready var score: Label = $"%Score" +onready var shards: Label = $"%Shards" # Called when the node enters the scene tree for the first time. func _ready(): + score.text = score.text % Game.marathon_score + shards.text = shards.text % (Game.marathon_shards + Game.shards) Fade.fade_in(0.4) get_tree().paused = true retry_button.grab_focus() @@ -14,10 +18,10 @@ func _ready(): func _on_Exit_button_down(): Fade.fade_out(0.4) yield(Fade, "fade_finished") - get_tree().paused = false - SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance() + get_tree().quit() func _on_Retry_button_down(): - get_tree().paused = true - Game.restart_level() + Fade.fade_out(0.4) + yield(Fade, "fade_finished") + SceneManager.current_scene = load("res://menus/marathon_start.tscn").instance() diff --git a/menus/game_over.tscn b/menus/game_over.tscn index d175fe3..67720c6 100644 --- a/menus/game_over.tscn +++ b/menus/game_over.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1] [ext_resource path="res://objects/hud/3d_text.tscn" type="PackedScene" id=2] [ext_resource path="res://ui/theme.tres" type="Theme" id=3] +[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=4] [ext_resource path="res://graphics/hud/pause_arrow.png" type="Texture" id=5] [ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=6] [ext_resource path="res://objects/hud/menu_sounds.tscn" type="PackedScene" id=7] @@ -91,8 +92,8 @@ margin_left = 16.0 margin_top = 8.0 margin_right = 93.0 margin_bottom = 44.0 -text = "RETRY LEVEL -EXIT TO MAP +text = "restart game +quit game " [node name="Retry" type="TextureButton" parent="Panel"] @@ -114,6 +115,7 @@ texture_focused = ExtResource( 5 ) [node name="MenuSounds" parent="." instance=ExtResource( 7 )] [node name="Label" type="Label" parent="."] +visible = false material = SubResource( 12 ) margin_top = 59.0 margin_right = 256.0 @@ -137,6 +139,32 @@ align = 1 text_material = SubResource( 9 ) anim = "game over" +[node name="Score" type="Label" parent="."] +unique_name_in_owner = true +material = ExtResource( 4 ) +anchor_right = 1.0 +margin_left = 4.0 +margin_top = 48.0 +margin_right = -4.0 +margin_bottom = 70.0 +theme = ExtResource( 3 ) +text = "Score: %05d" +align = 1 +valign = 1 + +[node name="Shards" type="Label" parent="."] +unique_name_in_owner = true +material = ExtResource( 4 ) +anchor_right = 1.0 +margin_left = 4.0 +margin_top = 70.0 +margin_right = -4.0 +margin_bottom = 92.0 +theme = ExtResource( 3 ) +text = "got %d/25 shards" +align = 1 +valign = 1 + [connection signal="button_down" from="Panel/Retry" to="." method="_on_Retry_button_down"] [connection signal="button_down" from="Panel/Retry" to="3DText" method="play_confirm_sound"] [connection signal="focus_entered" from="Panel/Retry" to="MenuSounds" method="play_select_sound"]