diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index 57d1df7..df2e30f 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -97,6 +97,33 @@ public class BShip { grid1 = null; grid2 = null; shipsPlaced = false; + + //Set new game grid size to selected dimensions. + + if(a.getSource() == boardSize[0]) { + rows = 8; + columns = 8; + } + + if(a.getSource() == boardSize[1]) { + rows = 10; + columns = 10; + } + + if(a.getSource() == boardSize[2]) { + rows = 12; + columns = 12; + } + + //Determine whether auto placement selected. + + if(a.getSource() == auto) { + autoPlacement = true; + } else { + autoPlacement = false; + } + + startGame(); } }