-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.ts
35 lines (30 loc) · 1.04 KB
/
Application.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Game } from './Game.js';
import { Player } from './Player.js';
import {
nextButton, disableEverySingleButton, mainCardsHTML, player0CardsHTML,
player1CardsHTML, player2CardsHTML, player3CardsHTML
} from './Reference.js';
/////////////////////////////////
//
//
/* SECTION BELOW: run the entirety of one game */
//
//
/////////////////////////////////
// COMMENTS: at the beginning of the game, every single button should be disabled
disableEverySingleButton();
// COMMENTS: each of the players should be created
let player1 = new Player(player0CardsHTML);
let player2 = new Player(player1CardsHTML);
let player3 = new Player(player2CardsHTML);
let player4 = new Player(player3CardsHTML);
// COMMENTS: create the game and add the players
let game = new Game(mainCardsHTML);
game.addPlayer(player1);
game.addPlayer(player2);
game.addPlayer(player3);
game.addPlayer(player4);
// COMMENTS: when the game starts, you'll need to change several things
nextButton.onclick = function () {
game.doNextAction();
}