Browse Source

Fix Gameboard in Gameloop

develop
Jonas Wagner 3 years ago
parent
commit
404260a233
  1. 5
      src/main/java/Game.java

5
src/main/java/Game.java

@ -15,7 +15,7 @@ public class Game {
for (Player p : g.players) { for (Player p : g.players) {
int c = 0; int c = 0;
int dice; int dice;
System.out.println("Spieler " + p.name + " an der Reihe.");
System.out.println(g.printGameboard(g, p));
do { do {
int figId; int figId;
dice = p.rollDice(); dice = p.rollDice();
@ -28,6 +28,8 @@ public class Game {
figId = p.choose(usableFigures); figId = p.choose(usableFigures);
} while(figId == -1); } while(figId == -1);
g.setFigure(figId, dice, p, g); g.setFigure(figId, dice, p, g);
clearScreen();
System.out.println(g.printGameboard(g, p));
} }
} while (g.checkDice(dice, p, c)); } while (g.checkDice(dice, p, c));
if(p.checkGameWin(p.figures)) { if(p.checkGameWin(p.figures)) {
@ -35,6 +37,7 @@ public class Game {
System.out.println("Spieler " + winner.name + " gewinnt!"); System.out.println("Spieler " + winner.name + " gewinnt!");
exit(42); exit(42);
} }
clearScreen();
} }
} }
} }

Loading…
Cancel
Save