Merge remote-tracking branch 'origin/master'

This commit is contained in:
no 2021-06-23 19:47:33 +02:00
commit 6c9c87b50e

View File

@ -82,9 +82,10 @@ public class match {
private static UIElementText timerUI; private static UIElementText timerUI;
private static UIElementText fpsCounter; private static UIElementText fpsCounter;
private static UIInputList inputListP1; private static UIInputList inputListP1;
private static UIElementText roundWon;
// Debug // Debug
public static boolean showP1Hitbox = false; public static boolean showP1Hitbox = false; // TODO modifier pour le rendre activable
public static boolean showP2Hitbox = false; public static boolean showP2Hitbox = false;
private static List<Hitbox> listHitboxObj = new ArrayList<>(); private static List<Hitbox> listHitboxObj = new ArrayList<>();
private static float slowFactor = 1f; private static float slowFactor = 1f;
@ -129,14 +130,45 @@ public class match {
* Ends the round. * Ends the round.
* Used for playing animations and such. * Used for playing animations and such.
* TODO : Implement this once we know what to do. * TODO : Implement this once we know what to do.
* @throws InterruptedException
*/ */
private static void endRound() { private static void endRound() throws InterruptedException {
if(roundP1) { if(roundP1) {
//texte de victoire
System.out.println("P1 won the round"); 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 { else {
//texte de victoire
System.out.println("P2 won the round"); 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); // System.out.println(i);
switch (i) { switch (i) {