From a0a5b015f1cbe0c2287643447b4e12844877c4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 23 Jun 2021 18:38:14 +0200 Subject: [PATCH 1/4] little text when a player win a round + at the begining of the second round players are in the right places --- src/gameplay/match/match.java | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index ff0275a..6e6a1fa 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -81,9 +81,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; @@ -128,14 +129,43 @@ 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)); + 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)); + 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)); } } @@ -298,7 +328,7 @@ public class match { } - private static void ac(int i) { + private static void ac(int i) throws InterruptedException { // System.out.println(i); switch (i) { From 0f430e5980d1cf903f60561c52f15d62758559f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 23 Jun 2021 20:22:22 +0200 Subject: [PATCH 2/4] endRound finished --- src/gameplay/match/match.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 6e6a1fa..e6ce01c 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -138,12 +138,13 @@ public class match { 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())); @@ -155,6 +156,7 @@ public class match { 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(); From 3170c713bd5b210ce98e509f7f4b83faec52b562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 23 Jun 2021 20:30:14 +0200 Subject: [PATCH 3/4] endRound finished --- src/gameplay/match/match.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index c83e527..4759f75 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -135,7 +135,7 @@ public class match { private static void endRound() throws InterruptedException { if(roundP1) { - //texte de victoire + //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)); From 56fca86614fd5eb53fd79bf373f393154d6c7eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 23 Jun 2021 20:44:13 +0200 Subject: [PATCH 4/4] connection test --- src/gameplay/match/match.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 4759f75..a64dcfb 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -135,7 +135,7 @@ public class match { private static void endRound() throws InterruptedException { if(roundP1) { - //texte de victoire + //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));