diff --git a/battleship/src/app.js b/battleship/src/app.js new file mode 100644 index 0000000..1fc9a84 --- /dev/null +++ b/battleship/src/app.js @@ -0,0 +1,14 @@ +export default class Game { + constructor(players) { + this.player1 = players.player1; + this.palyer2 = players.player2; + this.main(); + } + + main() { + // TODO take turns picking points to shoot a ship + this.player1.gameboard.receiveAttack([1, 2]); + this.player1.gameboard.receiveAttack([3, 8]); + console.log(this.player1.gameboard); + } +} diff --git a/battleship/src/index.js b/battleship/src/index.js index 938f857..0f196de 100644 --- a/battleship/src/index.js +++ b/battleship/src/index.js @@ -1,7 +1,6 @@ import { Player } from './components/player'; +import Game from './app'; const player1 = new Player('Player 1'); const player2 = new Player('CPU'); - -console.log(player1.gameboard); -console.log(player2.gameboard); +const game = new Game({ player1: player1, player2: player2 });