Merge branch 'master' of github.com:jokerx3/prp

This commit is contained in:
toksikk
2014-11-11 15:20:43 +01:00
+15 -17
View File
@@ -107,29 +107,26 @@ public class Opponent extends Player {
testY=this.getGridLocation().y + i;
testX=this.getGridLocation().x;
}
// Umwandeln der numerischen Darstellung der Richtung und CollisionHandler verständlich Angabe
// charDir = ( d == 'x' && i == -1 ) ? 'l' : 'r';
// charDir = ( d == 'y' && i == -1 ) ? 'u' : 'd';
// if (CollisionHandler.checkCollision(this, charDir)) {
// System.out.println("Kollision!");
// this.setGridLocation(testX, testY);
// this.prevd = d;
// this.previ = i;
// redecide = false;
// animate = true;
// break;
// }
// Testen ob die gewählte Richtung begehbar ist
if (MapGrid.getGridCell(testX,testY).isPath()) {
if ( d == 'x' && i == -1 ) {
charDir = 'l';
} else if ( d == 'x' && i == 1 ) {
charDir = 'r';
} else if ( d == 'y' && i == -1 ) {
charDir = 'u';
} else if ( d == 'y' && i == 1 ) {
charDir = 'd';
}
if (CollisionHandler.checkCollision(this, charDir)) {
System.out.println("Kollision!");
this.setGridLocation(testX, testY);
this.prevd = d;
this.previ = i;
redecide = false;
animate = true;
break;
}
}
}
}
@@ -159,6 +156,7 @@ public class Opponent extends Player {
}
if (stepCounter <= 0) {
stepCounter = 25;
if ( ! MapGrid.getGridCell(newx,newy).isPath()) {
redecide = true;
animate = false;