advancement on knight but still doesnt work
This commit is contained in:
parent
7526532ea4
commit
9c740ee1f0
|
|
@ -227,10 +227,17 @@ public class Move {
|
|||
|
||||
public boolean isKnightMoveValid(int x, int y, boolean color, int selectX, int selectY) {
|
||||
|
||||
if (selectX == x + 1 && selectY == y + 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(board.getPiece(selectX + 1, selectY + 2) != null) {
|
||||
if (color != board.getPiece(selectX + 1, selectY + 2).isWhite()) {
|
||||
if (selectX == x + 1 && selectY == y + 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
if (selectX == x + 1 && selectY == y + 2) {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (selectX == x - 1 && selectY == y - 2) {
|
||||
return true;
|
||||
|
|
@ -266,7 +273,8 @@ public class Move {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue