das spiel hat nun ein spielziel
parent
28f85f09de
commit
4ee6c9b8d4
BIN
bin/Game.class
BIN
bin/Game.class
Binary file not shown.
BIN
bin/Map.class
BIN
bin/Map.class
Binary file not shown.
|
@ -274,6 +274,9 @@ public class Game {
|
|||
|
||||
score++;
|
||||
scoreLabel.setText(Integer.toString(score));
|
||||
if(score == Map.maxScore) {
|
||||
System.out.println("YOU WON!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue