punkte kollision gefixt
parent
c3cdb120c6
commit
63b85260fd
BIN
bin/Brick.class
BIN
bin/Brick.class
Binary file not shown.
BIN
bin/Game.class
BIN
bin/Game.class
Binary file not shown.
BIN
bin/Ghost.class
BIN
bin/Ghost.class
Binary file not shown.
BIN
bin/Main.class
BIN
bin/Main.class
Binary file not shown.
BIN
bin/Map.class
BIN
bin/Map.class
Binary file not shown.
Binary file not shown.
BIN
bin/Player.class
BIN
bin/Player.class
Binary file not shown.
|
@ -223,7 +223,6 @@ public class Game {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// Kollision von Pac-Man mit Bricks:
|
||||
for (int i = 0; i < 35; i++) { // für jeden Brick
|
||||
for (int j = 0; j < 35; j++) { // für jeden Brick
|
||||
|
@ -254,12 +253,28 @@ public class Game {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((player.getPos('x', 0) - 10) % 20 == 0 && (player.getPos('y', 0) - 10) % 20 == 0 && Map.points[conv(player.getPos('y', 0))][conv(player.getPos('x', 0))] != null) {
|
||||
Map.points[conv(player.yPos)][conv(player.xPos)].setBounds(0, 0, 0, 0);
|
||||
for (int i = 0; i < 35; i++) {
|
||||
for (int j = 0; j < 35; j++) {
|
||||
if (Map.points[j][i] != null) {
|
||||
if (player.getPos('x', 0) < Map.points[j][i].xPos + 5
|
||||
&& player.getPos('x', 0) > Map.points[j][i].xPos - 5
|
||||
&& player.getPos('y', 0) < Map.points[j][i].yPos + 5
|
||||
&& player.getPos('y', 0) > Map.points[j][i].yPos - 5) {
|
||||
Map.points[j][i].setBounds(0, 0, 0, 0);
|
||||
|
||||
System.out.println("" + conv(player.yPos) + " " + conv(player.xPos));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* if ((player.getPos('x', 0) - 10) % 20 == 0 && (player.getPos('y', 0) - 10) %
|
||||
* 20 == 0 && Map.points[conv(player.getPos('y', 0))][conv(player.getPos('x',
|
||||
* 0))] != null) { Map.points[conv(player.yPos)][conv(player.xPos)].setBounds(0,
|
||||
* 0, 0, 0);
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
player.calcDir(0); // Berechnen wo Pac-Man als nächstes hin soll
|
||||
|
||||
|
|
Loading…
Reference in New Issue