From fbaae2f97a523a459e3175784f70af5697c511da Mon Sep 17 00:00:00 2001
From: Peter <pt033@hdm-stuttgart.de>
Date: Thu, 22 Feb 2024 22:53:50 +0100
Subject: [PATCH] feat(game scene): add game over overlay

---
 .../Controller/GameOverController.java         | 18 ++++++++++++++++++
 src/main/resources/fxml/GameOver.fxml          | 13 +++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 src/main/java/de/hdm_stuttgart/battlearena/Controller/GameOverController.java
 create mode 100644 src/main/resources/fxml/GameOver.fxml

diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameOverController.java b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameOverController.java
new file mode 100644
index 00000000..f36ed3cc
--- /dev/null
+++ b/src/main/java/de/hdm_stuttgart/battlearena/Controller/GameOverController.java
@@ -0,0 +1,18 @@
+package de.hdm_stuttgart.battlearena.Controller;
+
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.layout.VBox;
+
+import java.io.IOException;
+import java.util.Objects;
+
+public class GameOverController {
+    @FXML
+    private VBox parent;
+
+    @FXML
+    private void mainMenu() throws IOException {
+        parent.getScene().setRoot(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MenuBorderPane.fxml"))));
+    }
+}
diff --git a/src/main/resources/fxml/GameOver.fxml b/src/main/resources/fxml/GameOver.fxml
new file mode 100644
index 00000000..cfdd4015
--- /dev/null
+++ b/src/main/resources/fxml/GameOver.fxml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.layout.VBox?>
+<?import javafx.scene.text.Text?>
+
+<VBox fx:id="parent" alignment="CENTER" prefHeight="400.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hdm_stuttgart.battlearena.Controller.GameOverController">
+   <children>
+      <Text id="gameOver" strokeType="OUTSIDE" strokeWidth="0.0" text="Game Over" />
+      <Text strokeType="OUTSIDE" strokeWidth="0.0" text="One of you suck at this game" />
+      <Button mnemonicParsing="false" onAction="#mainMenu" style="-fx-text-fill: white;" text="Main Menu" />
+   </children>
+</VBox>
-- 
GitLab