Fixes game over menu being hidden by snake and verifies compatibility with HTML5 export

master
TechieDamien 2025-07-31 16:38:49 +01:00
parent 823d57a446
commit 8f6bc2c9a6
Signed by: TechieDamien
GPG Key ID: 2ACE3574E164B780
4 changed files with 7 additions and 1 deletions

3
.gitignore vendored
View File

@ -14,3 +14,6 @@ export_presets.cfg
.mono/
data_*/
mono_crash.*.json
# Export
/Export/

View File

@ -33,5 +33,6 @@ text = "Restart"
layout_mode = 2
text = "Main Menu"
[connection signal="visibility_changed" from="." to="." method="update_score"]
[connection signal="pressed" from="Restart" to="." method="restart"]
[connection signal="pressed" from="MainMenu" to="." method="back"]

View File

@ -43,6 +43,7 @@ offset_right = 156.0
offset_bottom = 197.0
[node name="GameOverMenu" parent="." instance=ExtResource("5_kry3j")]
z_index = 1
offset_left = 340.0
offset_top = 173.0
offset_right = 812.0

View File

@ -6,7 +6,8 @@ var main_menu : PackedScene = load("res://Scenes/main_menu.tscn")
var score_label : Label = $FinalScore
func update_score() -> void:
score_label.text = "Final Score\n{score}".format(GameManager)
if score_label != null:
score_label.text = "Final Score\n{score}".format(GameManager)
func restart():
get_tree().change_scene_to_packed(level)