das spiel hat nun ein spielziel

master
Lenz Wiechers 2020-06-06 15:23:14 +02:00
parent 28f85f09de
commit 4ee6c9b8d4
4 changed files with 6 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -274,6 +274,9 @@ public class Game {
score++;
scoreLabel.setText(Integer.toString(score));
if(score == Map.maxScore) {
System.out.println("YOU WON!!!");
}
}
}
}

View File

@ -19,6 +19,8 @@ public class Map {
public static int ghost_posX[] = new int[4];
public static int ghost_posY[] = new int[4];
public static int maxScore;
public static int pac_posX;
public static int pac_posY;
@ -70,6 +72,7 @@ public class Map {
ghost_posY[3] = 10 + 20 * i;
} else if (line.charAt(j) == ' ') {
points[i][j] = new Point(10 + 20 * j, 10 + 20 * i);
maxScore++;
}
} catch (Exception e) {