|
|
@ -194,10 +194,10 @@ public class GameLogic extends JPanel { |
|
|
|
// create player matchfield and set ships |
|
|
|
this.matchfield = new Matchfield(matchfieldSize); |
|
|
|
this.matchfield.createMatchfield(); |
|
|
|
this.matchfield.setShip(new Coordinate(4, 6), 2, 0); |
|
|
|
this.matchfield.setShip(new Coordinate(1, 3), 3, 0); |
|
|
|
this.matchfield.setShip(new Coordinate(9, 1), 4, 1); |
|
|
|
this.matchfield.setShip(new Coordinate(0, 0), 5, 0); |
|
|
|
this.matchfield.setShipOnRandomPosition(2); |
|
|
|
this.matchfield.setShipOnRandomPosition(3); |
|
|
|
this.matchfield.setShipOnRandomPosition(4); |
|
|
|
this.matchfield.setShipOnRandomPosition(5); |
|
|
|
|
|
|
|
this.aiLogic = new Logic(); |
|
|
|
this.aiLogic.setMatchfield(this.matchfield); |
|
|
@ -206,10 +206,10 @@ public class GameLogic extends JPanel { |
|
|
|
// matchfield) |
|
|
|
this.enemyMatchfield = new Matchfield(matchfieldSize); |
|
|
|
this.enemyMatchfield.createMatchfield(); |
|
|
|
this.enemyMatchfield.setShip(new Coordinate(8, 9), 2, 0); |
|
|
|
this.enemyMatchfield.setShip(new Coordinate(0, 2), 3, 1); |
|
|
|
this.enemyMatchfield.setShip(new Coordinate(7, 0), 4, 1); |
|
|
|
this.enemyMatchfield.setShip(new Coordinate(3, 6), 5, 0); |
|
|
|
this.enemyMatchfield.setShipOnRandomPosition(2); |
|
|
|
this.enemyMatchfield.setShipOnRandomPosition(3); |
|
|
|
this.enemyMatchfield.setShipOnRandomPosition(4); |
|
|
|
this.enemyMatchfield.setShipOnRandomPosition(5); |
|
|
|
|
|
|
|
// enter game loop |
|
|
|
this.gameState = GameLogic.RUNNING; |
|
|
|