diff --git a/src/main/java/com/battleship/gui/GameBoard.java b/src/main/java/com/battleship/gui/GameBoard.java index e3292a4..1239140 100644 --- a/src/main/java/com/battleship/gui/GameBoard.java +++ b/src/main/java/com/battleship/gui/GameBoard.java @@ -211,6 +211,8 @@ private void handleData(Object data) { enemyPositions[posToAttack[1]][posToAttack[2]].setBackground(Color.RED); setPlayerTurn(true); } else if (posToAttack[0] == GAME_WON) { + //Player has won, set the position to be red and display victory message + enemyPositions[posToAttack[1]][posToAttack[2]].setBackground(Color.RED); JOptionPane.showMessageDialog(frame, "You won!", "Congratulations", @@ -392,4 +394,4 @@ private void testPrint(Object src) { } -} \ No newline at end of file +}