win and lose label

This commit is contained in:
2025-10-30 17:19:43 +01:00
parent fafe5b03fa
commit afd201f250

View File

@@ -258,7 +258,7 @@ public class Game {
} }
public void nextTurn() { public void nextTurn() {
// end of if // end of if
if (white_chips == 0 && black_chips == 0) { if (white_chips == 0 && black_chips == 0 && game_state != 4) {
game_state = 1; game_state = 1;
hideAllButtons(); hideAllButtons();
if (current_selection != null) { if (current_selection != null) {
@@ -276,17 +276,23 @@ public class Game {
} }
else { else {
game_state = 0; if (game_state != 4) {
game_state = 0;
} // end of if
} }
if (currentTurnPlayer == "White") { if(game_state != 4) {
setLabelText("Black Turn"); if (currentTurnPlayer == "White") {
currentTurnPlayer = "Black"; setLabelText("Black Turn");
currentTurnPlayer = "Black";
}
else {
currentTurnPlayer = "White";
setLabelText("White Turn");
}
} }
else {
currentTurnPlayer = "White";
setLabelText("White Turn");
} // end of if-else
} }