From 5f6abbc817f32d64de58cd28d0de3726606a635e Mon Sep 17 00:00:00 2001 From: KahootChampion Date: Sat, 9 Mar 2019 23:52:51 -0700 Subject: [PATCH] ShipWarfare fight button coming along nicely --- src/ShipWarfareGUI.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ShipWarfareGUI.java b/src/ShipWarfareGUI.java index 07376eb..3dd7458 100644 --- a/src/ShipWarfareGUI.java +++ b/src/ShipWarfareGUI.java @@ -393,7 +393,7 @@ public class ShipWarfareGUI extends Application { } hitCounter++; } else { - + missCounter++; } @@ -621,11 +621,16 @@ public class ShipWarfareGUI extends Application { fightButton.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { - chooseFightOrRun.setText("Ohh, Fight ehh?"); + counter++; + chooseFightOrRun.setText("Ohh, Fight ehh?"); try { destroyPeasantShipsOrEscape(); } catch(Exception e){} + if (counter == 2) { + title.setVisible(false); + + } } });