Added game over screen

This commit is contained in:
2025-11-27 17:36:34 +03:00
parent 0e2d303298
commit 93b1bca915
11 changed files with 113 additions and 25 deletions
+21
View File
@@ -0,0 +1,21 @@
extends Control
signal show_main_menu
@onready var main_menu_button : Button = $%MainMenuButton
@onready var button_focus_timer : Timer = $ButtonFocusTimer
func _on_timer_timeout() -> void:
main_menu_button.grab_focus()
func _on_main_menu_button_pressed() -> void:
show_main_menu.emit()
func _on_visibility_changed() -> void:
if visible and button_focus_timer:
button_focus_timer.start()
+1
View File
@@ -0,0 +1 @@
uid://bkj8s7588e1ho
+44
View File
@@ -0,0 +1,44 @@
[gd_scene load_steps=3 format=3 uid="uid://duxm8n62j2qt6"]
[ext_resource type="Script" uid="uid://bkj8s7588e1ho" path="res://menu/game_over_screen.gd" id="1_rkkr6"]
[ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_uh3ar"]
[node name="GameOverScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_rkkr6")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Game Over"
horizontal_alignment = 1
[node name="MainMenuButton" type="Button" parent="CenterContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
mouse_filter = 2
theme = ExtResource("2_uh3ar")
text = "Main Menu"
[node name="ButtonFocusTimer" type="Timer" parent="."]
wait_time = 3.0
one_shot = true
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
[connection signal="timeout" from="ButtonFocusTimer" to="." method="_on_timer_timeout"]