Text shows up when check and checkmate ends game totally or when this

capture
This commit is contained in:
jefei 2025-05-18 00:41:58 +02:00
parent de3721d00c
commit 15827da582
2 changed files with 7 additions and 5 deletions

View File

@ -806,5 +806,4 @@ public String getWinnerText() {
if (isCheckmate(false)) return "White Wins by Checkmate!";
return "";
}
//hi
}

View File

@ -60,10 +60,13 @@ public class Game extends Thread {
}
private void aiPlayerTurn() {
if (board.isGameOver()) return;
if(isAITurn()) {
board.playMove(aiPlayer.computeBestMove(new Board(board)));
}
if (isAITurn() && !board.isCheckmateFlag()) {
Move bestMove = aiPlayer.computeBestMove(new Board(board));
if (bestMove != null) {
board.selectPiece(bestMove.getMovedPiece().getX(), bestMove.getMovedPiece().getY());
board.userTouch(bestMove.getToX(), bestMove.getToY());
}
}
}
public void clickCoords(int x, int y) {