From 4ef3fb4be80ee635437cce46e60ae08307b0c16c Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 20:49:54 +0100 Subject: [PATCH] update --- src/main/java/BattleShip/BShip.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index 190ede9..fa0b876 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -142,6 +142,25 @@ public class BShip { } } else { textArea.setText(grid2.getText()); + if(grid1.getClicked()) { + + textArea.setText(grid1.getText()); + + try { + Thread.sleep(2000); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + + if (!grid1.getEndGame()) { + grid2.go(); + textArea.setText(grid2.getText()); + } else { + textArea.setText(grid1.getText()); + } + + grid1.setClicked(); + } } } }