From c412a72c057c5c6e49bfbf1262107a22b67c8b28 Mon Sep 17 00:00:00 2001 From: PopsIDX Date: Mon, 17 Mar 2025 20:45:09 +0100 Subject: [PATCH] feat(menu): Add game over scene --- resources/localization/MenuTranslations.csv | 7 ++- .../MenuTranslations.en.translation | Bin 1350 -> 1434 bytes .../MenuTranslations.fr.translation | Bin 1409 -> 1501 bytes scenes/menus/gameOver/GameOver.gd | 7 +++ scenes/menus/gameOver/GameOver.tscn | 47 ++++++++++++++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 scenes/menus/gameOver/GameOver.gd create mode 100644 scenes/menus/gameOver/GameOver.tscn diff --git a/resources/localization/MenuTranslations.csv b/resources/localization/MenuTranslations.csv index cd61872..a5f8910 100644 --- a/resources/localization/MenuTranslations.csv +++ b/resources/localization/MenuTranslations.csv @@ -20,6 +20,9 @@ WEAPON_SWORD,Sword,Épée WEAPON_ATTRIBUTE_DAMAGE,Damage,Dégats WEAPON_ATTRIBUTE_RANGE,Range,Portée WEAPON_ATTRIBUTE_ATTACK_SPEED,Attack Speed,Vitesse d'attaque -DEATH_TEXT,You are dead...,Vous êtes mort +DEATH_TEXT,You are dead,Vous êtes mort RESPAWN_TEXT,Respawn in...,Réapparition dans... -SECOND_TEXT,second(s),seconde(s) \ No newline at end of file +SECOND_TEXT,second(s),seconde(s) +GAME_OVER_TITLE,Game Over,Perdu ! +GAME_OVER_RETRY,Retry,Réessayer +GAME_OVER_QUIT,Quit,Quitter diff --git a/resources/localization/MenuTranslations.en.translation b/resources/localization/MenuTranslations.en.translation index 5d163e8bde0fb90f840ae5484771c0375bffca08..023c645cb44dd4b149dd9b9cfb57fbcfb800b414 100644 GIT binary patch delta 307 zcmX@cHH&+LG$U(aPD+XCWCg~idJ_f)hW|id1*9E-*bRsSfEXke1*Jjk1Ry&Lh)bYi zbx;~4*8*gBA@MIDwdVvOZHd;=Ri;SeYdVn+elDL|ZuBnA=( zffArt6&7)jTmzCgE0C=K#BD*G>|SCu~Z+yruXfLLI%K2td3)5+~j*^{}L*D!vX zyq(!t6snZr5`T-X7*G`(2v1gL31<4kFu8{15p!N%-sCt|Ngj5f1W0jEaF8bMQ;UleD^rUY{spS(@AwB)2vQ6(ASgJ<8347aUl#xX delta 198 zcmcc1-N?N`nvumYGc9kjJmaML|4?AUz`$Sy#12601;ilX5GV~|M*-O>K%9pp1`-E> z5};TW7IBbV1Clr^kgWj3Z9vQj!IKS`E>4zYejp0vGhE_t(G>&Aae?q;GnQaRjm=#w O+KfExP)$L>LCyd@!BWNm diff --git a/scenes/menus/gameOver/GameOver.gd b/scenes/menus/gameOver/GameOver.gd new file mode 100644 index 0000000..3788cd7 --- /dev/null +++ b/scenes/menus/gameOver/GameOver.gd @@ -0,0 +1,7 @@ +extends Control + +func _on_retry_pressed() -> void: + print("Nothing to do here ! (for now)") + +func _on_quit_pressed() -> void: + get_tree().quit() diff --git a/scenes/menus/gameOver/GameOver.tscn b/scenes/menus/gameOver/GameOver.tscn new file mode 100644 index 0000000..590e548 --- /dev/null +++ b/scenes/menus/gameOver/GameOver.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=2 format=3 uid="uid://bvpukupq1sg2m"] + +[ext_resource type="Script" path="res://scenes/menus/gameOver/GameOver.gd" id="1_uppha"] + +[node name="GameOver" 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_uppha") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer"] +layout_mode = 2 +theme_override_constants/separation = 64 + +[node name="Label" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "GAME_OVER_TITLE" + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/CenterContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = 12 + +[node name="Retry" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "GAME_OVER_RETRY" + +[node name="Quit" type="Button" parent="MarginContainer/CenterContainer/VBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "GAME_OVER_QUIT" + +[connection signal="pressed" from="MarginContainer/CenterContainer/VBoxContainer/VBoxContainer/Retry" to="." method="_on_retry_pressed"] +[connection signal="pressed" from="MarginContainer/CenterContainer/VBoxContainer/VBoxContainer/Quit" to="." method="_on_quit_pressed"]