Commit 17858211 authored by BVBra_000's avatar BVBra_000

GUI updated

parent 4bf7eab3
......@@ -5,16 +5,19 @@
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.Pane?>
<Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="BSMain">
<Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="BSMain">
<children>
<Pane accessibleRole="COMBO_BOX" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0">
<Pane accessibleRole="COMBO_BOX" layoutY="-14.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0">
<children>
<ChoiceBox fx:id="DPx" layoutX="41.0" layoutY="679.0" prefHeight="28.0" prefWidth="184.0" />
<ChoiceBox fx:id="DPy" layoutX="225.0" layoutY="679.0" prefHeight="28.0" prefWidth="184.0" />
<Button fx:id="place" layoutX="225.0" layoutY="707.0" mnemonicParsing="false" onAction="#placeAction" prefHeight="28.0" prefWidth="184.0" text="*PLACE A SHIP*" textAlignment="CENTER" />
<ChoiceBox fx:id="shipSelection" layoutX="41.0" layoutY="707.0" prefHeight="28.0" prefWidth="184.0" />
<Label fx:id="label" alignment="CENTER" contentDisplay="CENTER" layoutX="409.0" layoutY="679.0" prefHeight="28.0" prefWidth="184.0" text="Stage : Place your Ships" textAlignment="JUSTIFY" wrapText="true" />
<Button fx:id="fire" layoutX="409.0" layoutY="706.0" mnemonicParsing="false" onAction="#fireAction" prefHeight="28.0" prefWidth="184.0" text="*FIRE*" />
<ChoiceBox fx:id="DPx" layoutX="30.0" layoutY="651.0" prefHeight="28.0" prefWidth="184.0" />
<ChoiceBox fx:id="DPy" layoutX="214.0" layoutY="651.0" prefHeight="28.0" prefWidth="184.0" />
<Button fx:id="place" layoutX="398.0" layoutY="651.0" mnemonicParsing="false" onAction="#placeAction" prefHeight="28.0" prefWidth="184.0" text="*PLACE A SHIP*" textAlignment="CENTER" />
<ChoiceBox fx:id="shipSelection" layoutX="30.0" layoutY="679.0" prefHeight="28.0" prefWidth="184.0" />
<Label fx:id="label" alignment="CENTER" contentDisplay="CENTER" layoutX="214.0" layoutY="680.0" prefHeight="28.0" prefWidth="184.0" text="Stage : Preperation" textAlignment="JUSTIFY" wrapText="true" />
<Button fx:id="fire" layoutX="582.0" layoutY="651.0" mnemonicParsing="false" onAction="#fireAction" prefHeight="28.0" prefWidth="184.0" text="*FIRE*" />
<Button fx:id="quit" layoutX="398.0" layoutY="681.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="184.0" text="*Quit*" />
<Button fx:id="battleStage" layoutX="582.0" layoutY="681.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="184.0" text="*Battle Stage*" />
<Label fx:id="admiral" layoutX="30.0" layoutY="634.0" prefHeight="17.0" prefWidth="734.0" text="Admiral Nutsey : &quot;Place your ships Captain!!!&quot;" />
</children>
</Pane>
</children>
......
......@@ -27,11 +27,11 @@ public class BSMain extends Application{
@FXML private Button place;
@FXML private Button fire;
@FXML private Button battleStage;
@FXML private Button quit;
@FXML private Label label;
@FXML private Label admiral;
static ObservableList<String> numbrz = FXCollections.observableArrayList("0","1","2","3","4","5","6","7","8","9");
static ObservableList<String> ltrz = FXCollections.observableArrayList("A","B","C","D","E","F","G","H","I","J");
......@@ -96,6 +96,8 @@ public class BSMain extends Application{
playerS.ShipPlacer(ship, x, y);
admiral.setText("Admiral Nutsey: Ship placed at " + x + y);
if (!playerG.MoveValidCheck(playerG, playerS.moves)){
label.setText("Cordinates are taken. not added to grid");
}
......
......@@ -135,6 +135,10 @@ public class ShipClass {
}
public void SunkCheck(ShipClass opponent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment