Never ending game fix

This commit is contained in:
Sagi Dayan 2016-03-20 23:42:50 +02:00
parent 6f31806f64
commit 8215eef840

View file

@ -171,24 +171,24 @@ public class GameEngine {
currentLevel++;
stage.removeMouseListener(scene);
stage.removeKeyListener(scene);
switch (currentLevel){
switch (currentLevel%7){
case 0:
scene = new FirstStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 1.0 =-", new int[]{5, 5});
scene = new FirstStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 5});
break;
case 1:
scene = new SecondStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 2.0 =-", new int[]{5, 5,5});
scene = new SecondStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 5,5});
break;
case 2:
scene = new ThirdStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 3.0 =-", new int[]{5, 0,2,8});
scene = new ThirdStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 0,2,8});
break;
case 3:
scene = new FourthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 4.0 =-", new int[]{5, 0,0,7});
scene = new FourthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 0,0,7});
break;
case 4:
scene = new FifthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 5.0 =-", new int[]{5, 1,3,8, 10, 10});
scene = new FifthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 1,3,8, 10, 10});
break;
case 5:
scene = new SixthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE 6.0 =-", new int[]{5, 0,0,0, 0, 0, 10, 20});
scene = new SixthStage(pWidth, pHeight, numOfPlayers, this, "-= STAGE "+(currentLevel+1)+".0 =-", new int[]{5, 0,0,0, 0, 0, 10, 20});
break;
case 6:
scene = new BlitzStage(pWidth, pHeight, numOfPlayers, this, "-= BLITZ STAGE =-", new int[]{5, 0,0,0, 0, 0, 0, 0, 0, 0, 0});