diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 0a8f596..8910355 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -28,6 +28,7 @@ import gameplay.input.ButtonIG; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; +import java.sql.SQLOutput; import java.util.ArrayList; import java.util.List; @@ -129,45 +130,27 @@ 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() 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)); - } + private static void endRound() { + String victoryTxt = roundP1 ? "Player1 won the round" : "Player2 won the round"; + + System.out.println(victoryTxt); + roundWon = new UIElementText(victoryTxt, 5f, 0.25f, 0.5f, 100f, engine); + engine.add_uiElement(roundWon); + + engine.update(); + engine.render(); + + glfwWaitEventsTimeout(1); + + 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)); + } /**