diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 97c26fe..a64dcfb 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -82,9 +82,10 @@ public class match { private static UIElementText timerUI; private static UIElementText fpsCounter; private static UIInputList inputListP1; + private static UIElementText roundWon; // Debug - public static boolean showP1Hitbox = false; + public static boolean showP1Hitbox = false; // TODO modifier pour le rendre activable public static boolean showP2Hitbox = false; private static List listHitboxObj = new ArrayList<>(); private static float slowFactor = 1f; @@ -129,14 +130,45 @@ public class match { * Ends the round. * Used for playing animations and such. * TODO : Implement this once we know what to do. + * @throws InterruptedException */ - private static void endRound() { + private static void endRound() throws InterruptedException { if(roundP1) { + //texte de victoire System.out.println("P1 won the round"); + roundWon = new UIElementText("Player1 won the round", 5f, 0.25f, 0.5f, 100f, engine); + roundWon.setBackground(new Vector3f(0f,0f,0f)); + roundWon.setShader("shaders/StylishShaders/WavyTextVert.glsl", "shaders/StylishShaders/TextFrag.glsl", true, true); + engine.add_uiElement(roundWon); + engine.update(); + engine.render(); + Thread.sleep(1000); + engine.remove_uiElement(roundWon); + + //replacement des sprites + objP1.translate(new Vector3f(-p1.getPosX(), -p1.getPosY())); + objP2.translate(new Vector3f(-p2.getPosX(), -p2.getPosY())); + objP1.getShadow().translate(new Vector3f(0f,-p1.getPosY(),0)); + objP2.getShadow().translate(new Vector3f(0f,-p2.getPosY(),0)); } else { + //texte de victoire System.out.println("P2 won the round"); + roundWon = new UIElementText("Player2 won the round", 5f, 0.25f, 0.5f, 100f, engine); + roundWon.setBackground(new Vector3f(0f,0f,0f)); + roundWon.setShader("shaders/StylishShaders/WavyTextVert.glsl", "shaders/StylishShaders/TextFrag.glsl", true, true); + engine.add_uiElement(roundWon); + engine.update(); + engine.render(); + Thread.sleep(1000); + engine.remove_uiElement(roundWon); + + //replacement des sprites + objP1.translate(new Vector3f(-p1.getPosX(), -p1.getPosY())); + objP2.translate(new Vector3f(-p2.getPosX(), -p2.getPosY())); + objP1.getShadow().translate(new Vector3f(0f,-p1.getPosY(),0)); + objP2.getShadow().translate(new Vector3f(0f,-p2.getPosY(),0)); } } @@ -299,7 +331,7 @@ public class match { } - private static void ac(int i) { + private static void ac(int i) throws InterruptedException { // System.out.println(i); switch (i) {