affichage des inputs activable via une variable dans le code

This commit is contained in:
Antoine 2021-06-25 15:39:40 +02:00
parent 3c20db686c
commit 7c448591ea

View File

@ -76,6 +76,7 @@ public class match {
private static HorizontalProgressBar healthBarP2Obj;
private static UIElementText timerUI;
private static UIElementText fpsCounter;
private static boolean showInputListP1 = false;
private static UIInputList inputListP1;
private static UIElementText matchWon;
@ -84,7 +85,7 @@ public class match {
private static int rightBoundary;
// Debug
public static boolean debugMode=true;
public static boolean debugMode = true;
public static boolean showP1Hitbox;
public static boolean showP2Hitbox;
private static List<Hitbox> listHitboxObj = new ArrayList<>();
@ -122,9 +123,11 @@ public class match {
objP1.getShadow().translate(new Vector3f(0f,p1.getPosY(),0));
objP2.getShadow().translate(new Vector3f(0f,p2.getPosY(),0));
// Crée l'InputList
inputListP1 = new UIInputList(inputsP1, 10f, 0f, 0.85f, 110f, engine);
engine.add_uiElement(inputListP1);
inputListP1.init();
if(showInputListP1){
inputListP1 = new UIInputList(inputsP1, 10f, 0f, 0.85f, 110f, engine);
engine.add_uiElement(inputListP1);
inputListP1.init();
}
}
/**
@ -147,7 +150,9 @@ public class match {
}
engine.remove_uiElement(matchWon);
engine.remove_uiElement(inputListP1);
if(showInputListP1){
engine.remove_uiElement(inputListP1);
}
//replacement des sprites
objP1.translate(new Vector3f(-p1.getPosX(), -p1.getPosY()));