From afd201f250d6535d7ddd26a9542bafbb37bce39f Mon Sep 17 00:00:00 2001 From: Nikolai Date: Thu, 30 Oct 2025 17:19:43 +0100 Subject: [PATCH] win and lose label --- Game.java | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Game.java b/Game.java index 57d2fc4..91c2d5c 100644 --- a/Game.java +++ b/Game.java @@ -258,7 +258,7 @@ public class Game { } public void nextTurn() { // end of if - if (white_chips == 0 && black_chips == 0) { + if (white_chips == 0 && black_chips == 0 && game_state != 4) { game_state = 1; hideAllButtons(); if (current_selection != null) { @@ -276,17 +276,23 @@ public class Game { } else { - game_state = 0; + if (game_state != 4) { + game_state = 0; + } // end of if + } - if (currentTurnPlayer == "White") { - setLabelText("Black Turn"); - currentTurnPlayer = "Black"; - } - else { - currentTurnPlayer = "White"; - setLabelText("White Turn"); - } // end of if-else + if(game_state != 4) { + if (currentTurnPlayer == "White") { + setLabelText("Black Turn"); + currentTurnPlayer = "Black"; + } + else { + currentTurnPlayer = "White"; + setLabelText("White Turn"); + } + } + }