mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2024-12-26 14:20:43 -05:00
feat: add main app
This commit is contained in:
parent
718fdf63b1
commit
e7ac5c84f9
2 changed files with 16 additions and 3 deletions
14
battleship/src/app.js
Normal file
14
battleship/src/app.js
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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 });
|
||||
|
|
Loading…
Reference in a new issue