roundcounter

This commit is contained in:
Léo 2021-06-24 14:40:22 +02:00
parent 8c146b324b
commit ecc501729c

View File

@ -87,6 +87,7 @@ public class match {
private static float slowFactor = 1f;
private static long timeStampFpsCounter;
private static int frameCounter;
private static int roundCounter=0;
private static Sprite objP1,objP2;
private static Engine engine;
@ -127,7 +128,8 @@ public class match {
* Used for playing animations and such.
*/
private static void endRound() {
String victoryTxt = roundP1 ? "Player1 won the round" : "Player2 won the round";
roundCounter++;
String victoryTxt = roundP1 ? "Player1 won the round"+roundCounter : "Player2 won the round"+roundCounter;
System.out.println(victoryTxt);
roundWon = new UIElementText(victoryTxt, 5f, 0.25f, 0.5f, 200f, engine);
@ -339,7 +341,7 @@ public class match {
//end round
case 11:
endRound();
if(roundsWonP1 >= 2 || roundsWonP2 >= 2) { endMatch();} //TODO : will probably need to specify more
if(roundsWonP1 >= (rounds/2 +1) || roundsWonP2 >= (rounds/2 +1)) { endMatch();} //TODO : will probably need to specify more
acCode = 0;
break;