still trying for knight
This commit is contained in:
parent
9c740ee1f0
commit
4ab757eec9
|
|
@ -227,16 +227,16 @@ public class Move {
|
||||||
|
|
||||||
public boolean isKnightMoveValid(int x, int y, boolean color, int selectX, int selectY) {
|
public boolean isKnightMoveValid(int x, int y, boolean color, int selectX, int selectY) {
|
||||||
|
|
||||||
if(board.getPiece(selectX + 1, selectY + 2) != null) {
|
|
||||||
if (color != board.getPiece(selectX + 1, selectY + 2).isWhite()) {
|
if (selectX == x + 1 && selectY == y + 2) {
|
||||||
if (selectX == x + 1 && selectY == y + 2) {
|
|
||||||
|
if(board.getPiece(selectX + 1, selectY + 2) != null) {
|
||||||
|
|
||||||
|
if(color != board.getPiece(selectX+ 1, selectY + 2).isWhite()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (selectX == x + 1 && selectY == y + 2) {
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectX == x - 1 && selectY == y - 2) {
|
if (selectX == x - 1 && selectY == y - 2) {
|
||||||
|
|
@ -273,8 +273,6 @@ public class Move {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue