endMatch évalué avant endRound
This commit is contained in:
parent
2dd019a8ea
commit
68cc275302
@ -132,7 +132,7 @@ public class match {
|
|||||||
*/
|
*/
|
||||||
private static void endRound() {
|
private static void endRound() {
|
||||||
roundCounter++;
|
roundCounter++;
|
||||||
String victoryTxt = roundP1 ? "Player1 won the round"+roundCounter : "Player2 won the round"+roundCounter;
|
String victoryTxt = roundP1 ? "Player1 won the round "+roundCounter : "Player2 won the round "+roundCounter;
|
||||||
|
|
||||||
System.out.println(victoryTxt);
|
System.out.println(victoryTxt);
|
||||||
matchWon = new UIElementText(victoryTxt, 5f, 0.25f, 0.5f, 200f, engine);
|
matchWon = new UIElementText(victoryTxt, 5f, 0.25f, 0.5f, 200f, engine);
|
||||||
@ -162,7 +162,7 @@ public class match {
|
|||||||
private static void endMatch() {
|
private static void endMatch() {
|
||||||
String victoryTxt = roundsWonP1 > roundsWonP2 ? "P1 won the match" : "P2 won the match";
|
String victoryTxt = roundsWonP1 > roundsWonP2 ? "P1 won the match" : "P2 won the match";
|
||||||
|
|
||||||
matchWon = new UIElementText(victoryTxt, 5f, 0.25f, 0.5f, 200f, engine);
|
matchWon = new UIElementText(victoryTxt, 5f, 0.3f, 0.5f, 200f, engine);
|
||||||
matchWon.setShader("/shaders/StylishShaders/WavyTextVert.glsl", "/shaders/StylishShaders/TextFrag.glsl", true, true);
|
matchWon.setShader("/shaders/StylishShaders/WavyTextVert.glsl", "/shaders/StylishShaders/TextFrag.glsl", true, true);
|
||||||
engine.add_uiElement(matchWon);
|
engine.add_uiElement(matchWon);
|
||||||
|
|
||||||
@ -357,8 +357,8 @@ public class match {
|
|||||||
|
|
||||||
//end round
|
//end round
|
||||||
case 11:
|
case 11:
|
||||||
|
if(roundsWonP1 >= (rounds/2 +1) || roundsWonP2 >= (rounds/2 +1)) { endMatch(); break;}
|
||||||
endRound();
|
endRound();
|
||||||
if(roundsWonP1 >= (rounds/2 +1) || roundsWonP2 >= (rounds/2 +1)) { endMatch();} //TODO : will probably need to specify more
|
|
||||||
acCode = 0;
|
acCode = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user