Browse Source

Update Methode void BuildGui and class NewGameListener

main
Thoumi Ngonga Brice 2 years ago
parent
commit
57f032e03b
  1. 27
      src/main/java/BattleShip/BShip.java

27
src/main/java/BattleShip/BShip.java

@ -97,6 +97,33 @@ public class BShip {
grid1 = null; grid1 = null;
grid2 = null; grid2 = null;
shipsPlaced = false; 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();
} }
} }

Loading…
Cancel
Save