-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bundle.js
520 lines (453 loc) · 47.2 KB
/
main.bundle.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var Game = __webpack_require__(1);
var canvas = document.getElementById('grid');
var context = canvas.getContext('2d');
var game = new Game(context, canvas.height, canvas.width);
document.addEventListener('keydown', first);
function first(e) {
if (e.keyCode === 52) {
document.removeEventListener('keydown', first);
game.gameLoop();
document.addEventListener('keydown', keyStateDown);
}
}
function keyStateDown(e) {
e.preventDefault();
game.moveChecker(e.keyCode);
}
context.font = '20px Arial';
context.fillText('Press 4 to Start', canvas.width / 2 - 70, canvas.height / 2);
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Board = __webpack_require__(2);
var Red = __webpack_require__(3);
var Blue = __webpack_require__(4);
var Game = function () {
function Game(context, canvasHeight, canvasWidth) {
_classCallCheck(this, Game);
this.canvasHeight = canvasHeight;
this.canvasWidth = canvasWidth;
this.context = context;
this.gameLoop = this.gameLoop.bind(this);
this.red = new Red();
this.blue = new Blue();
this.gameBoard = new Board();
this.playerRed = true;
this.checkersOnBoard = [];
this.redScore = 0;
this.blueScore = 0;
}
_createClass(Game, [{
key: 'drawPieces',
value: function drawPieces() {
this.checkersOnBoard.forEach(function (item) {
this.context.beginPath();
this.context.arc(item[0], item[1], 40, 0, Math.PI * 2);
this.context.fillStyle = item[2];
this.context.fill();
}.bind(this));
}
}, {
key: 'checkMaxCheckers',
value: function checkMaxCheckers() {
if (this.checkersOnBoard.length === 42) {
this.gameBoard = new Board();
this.context.clearRect(0, 0, 700, 700);
this.checkersOnBoard = [];
}
}
}, {
key: 'moveChecker',
value: function moveChecker(key) {
if (this.playerRed) {
this.red.selectCol(key, this);
} else {
this.blue.selectCol(key, this);
}
}
}, {
key: 'switchPlayer',
value: function switchPlayer(player, column, row) {
this.gameBoard.checkHorizontalWin();
this.gameBoard.checkVerticalWin(column, player);
this.gameBoard.checkDiagonalWin(column, row, player);
if (player === 'red') {
this.red = new Red();
this.red.draw(this.context);
} else {
this.blue = new Blue();
this.blue.draw(this.context);
}
this.checkMaxCheckers();
}
}, {
key: 'updateScore',
value: function updateScore() {
document.getElementById('red-score').innerText = this.redScore;
document.getElementById('blue-score').innerText = this.blueScore;
}
}, {
key: 'gameLoop',
value: function gameLoop() {
this.context.clearRect(0, 0, 700, 700);
Game.drawBoard(this.context);
this.drawPieces();
if (this.playerRed) {
this.red.draw(this.context);
} else {
this.blue.draw(this.context);
}
if (this.gameBoard.win) {
var winnerColor = this.playerRed ? 'Blue' : 'Red';
if (winnerColor === 'Red') {
this.redScore++;
} else {
this.blueScore++;
}
document.getElementById('show-winner').innerText = winnerColor + ' Wins!!';
this.updateScore();
this.gameBoard = new Board();
this.context.clearRect(0, 0, 700, 700);
this.checkersOnBoard = [];
this.gameBoard.win = false;
window.requestAnimationFrame(this.gameLoop);
} else {
window.requestAnimationFrame(this.gameLoop);
}
}
}], [{
key: 'drawBoard',
value: function drawBoard(context) {
for (var i = 0; i <= 600; i = i + 100) {
context.strokeStyle = 'black';
context.lineWidth = 2;
context.moveTo(i, 100);
context.lineTo(i, 700);
context.stroke();
for (var j = 100; j <= 600; j = j + 100) {
context.moveTo(0, j);
context.lineTo(700, j);
context.strokeStyle = 'black';
context.stroke();
}
}
}
}]);
return Game;
}();
module.exports = Game;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Board = function () {
function Board() {
_classCallCheck(this, Board);
this.status = [[null, null, null, null, null, null, null], [null, null, null, null, null, null, null], [null, null, null, null, null, null, null], [null, null, null, null, null, null, null], [null, null, null, null, null, null, null], [null, null, null, null, null, null, null], [null, null, null, null, null, null, null]];
this.win = false;
this.checkersInRow = 1;
}
_createClass(Board, [{
key: 'updateBoard',
value: function updateBoard(col, color) {
var column = this.updateCol(col);
var row = this.updateRow(column, color);
return [column, row];
}
}, {
key: 'checkUpperLeftdownRight',
value: function checkUpperLeftdownRight(column, row) {
var color = this.status[row][column];
var tempArr = [color];
var tempArr2 = [];
if (column >= 3 && row >= 2) {
var tempRow = row;
for (var i = column; i > 0; i--) {
tempRow--;
if (tempRow > 1) {
if (this.status[tempRow][i - 1] === color) {
tempArr.push(this.status[tempRow][i - 1]);
}
}
}
}
if (column >= 1 && row >= 2) {
var _tempRow = row;
for (var j = column; j < 6; j++) {
_tempRow++;
if (_tempRow <= 6 && _tempRow > 1) {
if (this.status[_tempRow][j + 1] === color) {
tempArr2.push(this.status[_tempRow][j + 1]);
}
}
}
}
var finalArr = tempArr.concat(tempArr2);
var numOfCheckers = 0;
for (var a = 0; a < finalArr.length; a++) {
if (finalArr[a] === color) {
numOfCheckers++;
if (numOfCheckers >= 4) {
this.win = true;
}
}
}
}
}, {
key: 'checkUpperRightDownLeft',
value: function checkUpperRightDownLeft(column, row) {
var color = this.status[row][column];
var tempArr = [color];
var tempArr2 = [];
if (column <= 3 && row >= 2) {
var tempRow = row;
for (var i = column; i < 6; i++) {
tempRow--;
if (tempRow > 1 && this.status[tempRow][i + 1] === color) {
tempArr.push(this.status[tempRow][i + 1]);
}
}
}
if (column >= 1 && row >= 2) {
var _tempRow2 = row;
for (var j = column; j > 1; j--) {
_tempRow2++;
if (_tempRow2 <= 6 && _tempRow2 > 1) {
if (this.status[_tempRow2][j - 1] === color) {
tempArr2.push(this.status[_tempRow2][j - 1]);
}
}
}
}
var finalArr = tempArr.concat(tempArr2);
var numOfCheckers = 0;
for (var a = 0; a < finalArr.length; a++) {
if (finalArr[a] === color) {
numOfCheckers++;
if (numOfCheckers >= 4) {
this.win = true;
}
}
}
}
}, {
key: 'checkDiagonalWin',
value: function checkDiagonalWin(column, row) {
this.checkUpperLeftdownRight(column, row);
this.checkUpperRightDownLeft(column, row);
}
}, {
key: 'checkVerticalWin',
value: function checkVerticalWin(column, player) {
player = player === 'red' ? 'blue' : 'red';
var tempArr = [];
for (var i = 1; i < 7; i++) {
if (this.status[i][column] !== null) {
tempArr.push(this.status[i][column]);
var result = tempArr.reduce(function (counter, value) {
if (value === player) {
return counter += 1;
}
}, 0);
if (result === 4) {
this.win = true;
}
}
}
}
}, {
key: 'checkHorizontalWin',
value: function checkHorizontalWin() {
for (var i = 1; i < 7; i++) {
var checkersInRow = 1;
for (var j = 0; j < 7; j++) {
if (this.status[i][j] === this.status[i][j + 1] && this.status[i][j + 1] !== null) {
checkersInRow++;
} else {
checkersInRow = 1;
}
if (checkersInRow === 4) {
this.win = true;
}
}
}
}
}, {
key: 'updateCol',
value: function updateCol(col) {
if (col === 50) {
return 0;
} else if (col === 150) {
return 1;
} else if (col === 250) {
return 2;
} else if (col === 350) {
return 3;
} else if (col === 450) {
return 4;
} else if (col === 550) {
return 5;
} else {
return 6;
}
}
}, {
key: 'updateRow',
value: function updateRow(column, color) {
for (var i = 6; i >= 1; i--) {
if (this.status[i][column] === null) {
this.status[i][column] = color;
return i;
}
}
}
}]);
return Board;
}();
module.exports = Board;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Red = function () {
function Red() {
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 350;
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
_classCallCheck(this, Red);
this.x = x;
this.y = y;
this.color = 'red';
}
_createClass(Red, [{
key: 'draw',
value: function draw(context) {
context.beginPath();
context.arc(this.x, this.y, 40, 0, Math.PI * 2);
context.fillStyle = 'red';
context.fill();
}
}, {
key: 'selectCol',
value: function selectCol(key, game) {
if (key === 37 && game.red.x > 50) {
game.red.x -= 100;
} else if (key === 39 && game.red.x < 650) {
game.red.x += 100;
} else if (key === 13 || key === 32) {
var gridCoordinates = game.gameBoard.updateBoard(this.x, 'red');
var row = gridCoordinates[1];
var column = gridCoordinates[0];
var tempArr = [];
this.y = row * 100 + 50;
tempArr.push(this.x, this.y, 'red');
game.checkersOnBoard.push(tempArr);
game.playerRed = false;
game.switchPlayer('blue', column, row);
}
}
}]);
return Red;
}();
module.exports = Red;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Blue = function () {
function Blue() {
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 350;
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
_classCallCheck(this, Blue);
this.x = x;
this.y = y;
this.color = 'blue';
}
_createClass(Blue, [{
key: 'draw',
value: function draw(context) {
context.beginPath();
context.arc(this.x, this.y, 40, 0, Math.PI * 2);
context.fillStyle = 'blue';
context.fill();
}
}, {
key: 'selectCol',
value: function selectCol(key, game) {
if (key === 37 && game.blue.x > 50) {
game.blue.x -= 100;
} else if (key === 39 && game.blue.x < 650) {
game.blue.x += 100;
} else if (key === 13 || key === 32) {
var gridCoordinates = game.gameBoard.updateBoard(this.x, 'blue');
var row = gridCoordinates[1];
var column = gridCoordinates[0];
var tempArr = [];
this.y = row * 100 + 50;
tempArr.push(this.x, this.y, 'blue');
game.checkersOnBoard.push(tempArr);
game.playerRed = true;
game.switchPlayer('red', column, row);
}
}
}]);
return Blue;
}();
module.exports = Blue;
/***/ })
/******/ ]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgZDIxOWZkNjgxNDZkZTIyOTBmODEiLCJ3ZWJwYWNrOi8vLy4vbGliL2luZGV4LmpzIiwid2VicGFjazovLy8uL2xpYi9HYW1lLmpzIiwid2VicGFjazovLy8uL2xpYi9Cb2FyZC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvUmVkLmpzIiwid2VicGFjazovLy8uL2xpYi9CbHVlLmpzIl0sIm5hbWVzIjpbIkdhbWUiLCJyZXF1aXJlIiwiY2FudmFzIiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50QnlJZCIsImNvbnRleHQiLCJnZXRDb250ZXh0IiwiZ2FtZSIsImhlaWdodCIsIndpZHRoIiwiYWRkRXZlbnRMaXN0ZW5lciIsImZpcnN0IiwiZSIsImtleUNvZGUiLCJyZW1vdmVFdmVudExpc3RlbmVyIiwiZ2FtZUxvb3AiLCJrZXlTdGF0ZURvd24iLCJwcmV2ZW50RGVmYXVsdCIsIm1vdmVDaGVja2VyIiwiZm9udCIsImZpbGxUZXh0IiwiQm9hcmQiLCJSZWQiLCJCbHVlIiwiY2FudmFzSGVpZ2h0IiwiY2FudmFzV2lkdGgiLCJiaW5kIiwicmVkIiwiYmx1ZSIsImdhbWVCb2FyZCIsInBsYXllclJlZCIsImNoZWNrZXJzT25Cb2FyZCIsInJlZFNjb3JlIiwiYmx1ZVNjb3JlIiwiZm9yRWFjaCIsIml0ZW0iLCJiZWdpblBhdGgiLCJhcmMiLCJNYXRoIiwiUEkiLCJmaWxsU3R5bGUiLCJmaWxsIiwibGVuZ3RoIiwiY2xlYXJSZWN0Iiwia2V5Iiwic2VsZWN0Q29sIiwicGxheWVyIiwiY29sdW1uIiwicm93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iBjb3VudGVyICs9IDE7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcbiAgICAgICAgaWYgKHJlc3VsdCA9PT0gNCkge1xuICAgICAgICAgIHRoaXMud2luID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGNoZWNrSG9yaXpvbnRhbFdpbiAoKSB7XG4gICAgZm9yIChsZXQgaSA9IDE7IGkgPCA3OyBpKyspIHtcbiAgICAgIGxldCBjaGVja2Vyc0luUm93ID0gMTtcblxuICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCA3OyBqKyspIHtcbiAgICAgICAgaWYgKHRoaXMuc3RhdHVzW2ldW2pdID09PSB0aGlzLnN0YXR1c1tpXVtqICsgMV0gJiYgdGhpcy5zdGF0dXNbaV1baiArIDFdICE9PSBudWxsKSB7XG4gICAgICAgICAgY2hlY2tlcnNJblJvdysrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNoZWNrZXJzSW5Sb3cgPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjaGVja2Vyc0luUm93ID09PSA0KSB7XG4gICAgICAgICAgdGhpcy53aW4gPSB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgdXBkYXRlQ29sIChjb2wpIHtcbiAgICBpZiAoY29sID09PSA1MCkge1xuICAgICAgcmV0dXJuIDA7XG4gICAgfSBlbHNlIGlmIChjb2wgPT09IDE1MCkge1xuICAgICAgcmV0dXJuIDE7XG4gICAgfSBlbHNlIGlmIChjb2wgPT09IDI1MCkge1xuICAgICAgcmV0dXJuIDI7XG4gICAgfSBlbHNlIGlmIChjb2wgPT09IDM1MCkge1xuICAgICAgcmV0dXJuIDM7XG4gICAgfSBlbHNlIGlmIChjb2wgPT09IDQ1MCkge1xuICAgICAgcmV0dXJuIDQ7XG4gICAgfSBlbHNlIGlmIChjb2wgPT09IDU1MCkge1xuICAgICAgcmV0dXJuIDU7XG4gIC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