-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript
More file actions
1865 lines (1865 loc) · 90.3 KB
/
script
File metadata and controls
1865 lines (1865 loc) · 90.3 KB
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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="GameLoop.ts" />
var Game;
(function (Game) {
var MenuController = (function () {
function MenuController(gameloop, canvas, width, height, model, menuView) {
this.gameloop = gameloop;
this.canvas = canvas;
this.model = model;
this.height = height;
this.width = width;
this.menuView = menuView;
this.notEnoughCat = false;
}
MenuController.prototype.takeInput = function () {
this.mobileClick = this.mobileClick.bind(this);
this.canvas.addEventListener('click', this.mobileClick);
};
MenuController.prototype.mobileClick = function (e) {
var mobileClickY = event.y;
mobileClickY -= this.canvas.offsetTop;
var mobileClickX = event.x;
mobileClickX -= this.canvas.offsetLeft;
if (this.notEnoughCat) {
this.catClick(mobileClickX, mobileClickY);
}
else {
this.click(mobileClickX, mobileClickY);
}
};
MenuController.prototype.catClick = function (X, Y) {
clearTimeout(this.menuView.animationOne);
this.notEnoughCat = false;
this.menuView.render(this.gameloop.currentGame);
};
MenuController.prototype.click = function (X, Y) {
if (X < 183 * this.width / 375 && X > 7 * this.width / 375) {
if (Y < 342 * this.height / 667 && Y > 291 * this.height / 667) {
this.switchToGameState();
}
else if (Y < 410 * this.height / 667 && Y > 352 * this.height / 667) {
this.switchToCategoriesState();
}
else if (Y < 475 * this.height / 667 && Y > 425 * this.height / 667) {
this.gameloop.switchGameModes();
}
else if (Y < 540 * this.height / 667 && Y > 483 * this.height / 667) {
this.switchToHelpState();
}
}
};
MenuController.prototype.switchStates = function () {
clearTimeout(this.menuView.balloonAnimation);
this.canvas.removeEventListener('click', this.mobileClick);
console.log("switching states");
};
MenuController.prototype.switchToGameState = function () {
if (this.model.gameCanStart()) {
var m = this.model;
var s = m.gameView;
//s.inMenu = false;
this.switchStates();
this.gameloop.switchToGameState();
}
else {
this.notEnoughCat = true;
this.menuView.renderNotEnoughCategories(-10, 1, 0);
}
};
MenuController.prototype.switchToCategoriesState = function () {
this.switchStates();
this.gameloop.switchToCategoriesState();
};
MenuController.prototype.switchToHelpState = function () {
this.switchStates();
this.gameloop.switchToHelpState();
};
return MenuController;
}());
Game.MenuController = MenuController;
})(Game || (Game = {}));
var Game;
(function (Game) {
var Resources = (function () {
function Resources() {
this.menu_background1 = new Image();
this.menu_background2 = new Image();
this.buttons = new Image();
this.buttons2 = new Image();
this.game_background = new Image();
this.game_background2 = new Image();
this.forehead = new Image();
this.pass = new Image();
this.roundPicking = new Image();
this.correct = new Image();
this.endGame_background = new Image();
this.rightArrow = new Image();
this.leftArrow = new Image();
this.rightArrowPressed = new Image();
this.leftArrowPressed = new Image();
this.category_background = new Image();
this.category_background1 = new Image();
this.noCatSel = new Image();
this.balloon = new Image();
this.kids = new Image();
this.orangeBackground = new Image();
this.stand = new Image();
this.slime = new Image();
this.blueBackground = new Image();
this.nextRoundButton = new Image();
this.helpScreen1 = new Image();
this.helpScreen2 = new Image();
this.menu_background1.src = "thenewMenu.png";
this.menu_background2.src = "thenewMenu2.png";
this.game_background.src = "InGame.png";
this.game_background2.src = "InGame2.png";
this.roundPicking.src = "RoundPickingBackground.png";
this.forehead.src = "forehead.png";
this.pass.src = "pass.png";
this.correct.src = "correct.png";
this.endGame_background.src = "endGame.png";
this.rightArrow.src = "rightArrow.png";
this.leftArrow.src = "leftArrow.png";
this.rightArrowPressed.src = "rightArrowClicked.png";
this.leftArrowPressed.src = "leftArrowClicked.png";
this.category_background.src = "money.png";
this.category_background1.src = "categories_foreground_menuselected.png";
this.noCatSel.src = "noCategorySelected.png";
this.balloon.src = "balloon.png";
this.kids.src = "kids.png";
this.orangeBackground.src = "orangeBack.png";
this.stand.src = "stand.png";
this.slime.src = "slime.png";
this.blueBackground.src = "blueBackground.png";
this.buttons.src = "buttons.png";
this.buttons2.src = "buttons2.png";
this.nextRoundButton.src = "NextRound.png";
this.helpScreen1.src = "HelpScreen1.png";
this.helpScreen2.src = "HelpScreen2.png";
}
Resources.prototype.hasLoaded = function () {
return (this.menu_background1.complete &&
this.menu_background2.complete &&
this.game_background.complete &&
this.game_background2.complete &&
this.roundPicking.complete &&
this.forehead.complete &&
this.pass.complete &&
this.correct.complete &&
this.endGame_background.complete &&
this.rightArrow.complete &&
this.rightArrowPressed.complete &&
this.leftArrowPressed.complete &&
this.category_background.complete &&
this.category_background1.complete &&
this.noCatSel.complete &&
this.balloon.complete &&
this.orangeBackground.complete &&
this.stand.complete &&
this.blueBackground.complete &&
this.slime.complete &&
this.kids.complete &&
this.buttons.complete &&
this.buttons2.complete &&
this.nextRoundButton.complete &&
this.helpScreen1.complete &&
this.helpScreen2.complete);
};
return Resources;
}());
Game.Resources = Resources;
})(Game || (Game = {}));
/// <reference path="Resources.ts" />
var Game;
(function (Game) {
var MenuView = (function () {
function MenuView(resources, context, width, height, gameMode) {
this.resources = resources;
this.buttons = this.resources.buttons;
this.buttons2 = this.resources.buttons2;
this.orangeBackground = this.resources.orangeBackground;
this.balloon = this.resources.balloon;
this.stand = this.resources.stand;
this.blueBackground = this.resources.blueBackground;
this.slime = this.resources.slime;
this.menu_background1 = this.resources.menu_background1;
this.kids = this.resources.kids;
this.menu_background2 = this.resources.menu_background2;
this.arrow = this.resources.leftArrowPressed;
this.noCatSel = this.resources.noCatSel;
this.context = context;
this.width = width;
var self = this;
this.height = height;
this.gameMode = gameMode;
this.menuOptions = ["Play Game", "Categories", "Mode", "Help"];
this.animationTwo = false;
this.animationThree = false;
this.youCanClick = false;
this.balloonHeight = this.height * 200 / 667;
this.balloonDirection = false;
}
MenuView.prototype.renderNotEnoughCategories = function (height, velocity, friction) {
clearTimeout(this.balloonAnimation);
if (friction == 3) {
this.youCanClick = true;
}
else {
var gravity = 0.2;
var bounceFactor = 0.5;
this.clearCanvas();
this.drawBackGround();
this.context.drawImage(this.balloon, this.width - this.width * 230 / 375, this.balloonHeight, this.width * 280 / 375, this.height * 320 / 667);
this.drawButtons();
this.context.drawImage(this.noCatSel, this.width / 5, height, this.width / 1.5, this.height / 3);
height += velocity;
velocity += gravity;
if (height + this.height / 6 > this.height / 2) {
height = this.height / 2 - this.height / 6;
velocity *= -bounceFactor;
++friction;
}
var self = this;
var f = function () { self.renderNotEnoughCategories(height, velocity, friction); };
this.animationOne = setTimeout(f, 1000 / 60);
}
};
MenuView.prototype.clearCanvas = function () {
this.context.clearRect(0, 0, this.width, this.height);
};
MenuView.prototype.drawBackGround = function () {
this.context.drawImage(this.menu_background1, 0, 0, this.width, this.height);
};
MenuView.prototype.drawButtons = function () {
if (this.gameMode == 1) {
this.context.drawImage(this.buttons, 0, this.height / 2.5, this.width / 2, this.height / 2.4);
}
else {
this.context.drawImage(this.buttons2, 0, this.height / 2.5, this.width / 2, this.height / 2.4);
}
};
MenuView.prototype.render = function (gameMode) {
if (this.balloonAnimation) {
clearTimeout(this.balloonAnimation);
}
this.context.drawImage(this.menu_background1, 0, 0, this.width, this.height);
var targetHeightTop = this.height * 180 / 667;
var targetHeightBottom = this.height * 250 / 667;
this.balloonAnimation1(this.balloonHeight, targetHeightTop, targetHeightBottom, this.balloonDirection);
};
MenuView.prototype.balloonAnimation1 = function (height, top, bottom, direction) {
if (height >= bottom) {
direction = true;
}
else if (height <= top) {
direction = false;
}
if (direction) {
this.clearCanvas();
this.drawBackGround();
this.context.drawImage(this.balloon, this.width - this.width * 230 / 375, height, this.width * 280 / 375, this.height * 320 / 667);
this.drawButtons();
height -= .1;
this.balloonHeight = height;
this.balloonDirection = direction;
var self = this;
var f = function () { self.balloonAnimation1(height, top, bottom, direction); };
this.balloonAnimation = setTimeout(f, 1000 / 600);
}
else {
this.clearCanvas();
this.drawBackGround();
this.context.drawImage(this.balloon, this.width - this.width * 230 / 375, height, this.width * 280 / 375, this.height * 320 / 667);
this.drawButtons();
height += .1;
this.balloonHeight = height;
this.balloonDirection = direction;
var self = this;
var f = function () { self.balloonAnimation1(height, top, bottom, direction); };
this.balloonAnimation = setTimeout(f, 1000 / 600);
}
};
return MenuView;
}());
Game.MenuView = MenuView;
})(Game || (Game = {}));
/// <reference path="GameLoop.ts" />
var Game;
(function (Game) {
var HelpController = (function () {
function HelpController(gameloop, canvas, width, height, model, helpView, gameMode) {
this.gameloop = gameloop;
this.canvas = canvas;
this.model = model;
this.height = height;
this.width = width;
this.helpView = helpView;
this.gameMode = gameMode;
}
HelpController.prototype.takeInput = function () {
this.mobileClick = this.mobileClick.bind(this);
this.canvas.addEventListener('touchstart', this.mobileClick);
};
HelpController.prototype.mobileClick = function (e) {
var mobileClickX = e.targetTouches[0].pageX;
var mobileClickY = e.targetTouches[0].pageY;
/*
var mobileClickY = event.y;
mobileClickY -= this.canvas.offsetTop;
var mobileClickX = event.x;
mobileClickX -= this.canvas.offsetLeft;
*/
if (mobileClickY > this.height * 250 / 640 && mobileClickY < this.height * 340 / 640 && mobileClickX < this.width * 125 / 360) {
if (this.gameMode == 1) {
this.helpView.render(2);
this.gameMode = 2;
}
else {
this.helpView.render(1);
this.gameMode = 1;
}
}
else if (mobileClickY < this.height * 100 / 640 && mobileClickX < this.width * 100 / 360) {
this.switchToMenuState();
}
};
/*
catClick(X,Y){
clearTimeout(this.menuView.animationOne);
this.notEnoughCat = false;
this.menuView.render(this.gameloop.currentGame);
}
*/
HelpController.prototype.switchStates = function () {
this.canvas.removeEventListener('touchstart', this.mobileClick);
console.log("switching states");
};
HelpController.prototype.switchToMenuState = function () {
this.switchStates();
this.gameloop.switchToMenuState();
};
return HelpController;
}());
Game.HelpController = HelpController;
})(Game || (Game = {}));
/// <reference path="Resources.ts" />
var Game;
(function (Game) {
var HelpView = (function () {
function HelpView(resources, context, width, height, gameMode) {
this.resources = resources;
this.helpScreen1 = resources.helpScreen1;
this.helpScreen2 = resources.helpScreen2;
this.context = context;
this.width = width;
this.height = height;
/*this.buttons = this.resources.buttons;
this.buttons2 = this.resources.buttons2;
this.orangeBackground = this.resources.orangeBackground;
this.balloon = this.resources.balloon;
this.stand = this.resources.stand;
this.blueBackground = this.resources.blueBackground;
this.slime = this.resources.slime;
this.menu_background1 = this.resources.menu_background1;
this.kids = this.resources.kids;
this.menu_background2 = this.resources.menu_background2;
this.arrow = this.resources.leftArrowPressed;
this.noCatSel = this.resources.noCatSel;
this.context = context;
this.width = width;
var self = this;
this.height = height;
this.gameMode = gameMode;
this.menuOptions = ["Play Game", "Categories", "Mode", "Help"];
this.animationTwo = false;
this.animationThree = false;
this.youCanClick = false;
this.balloonHeight = this.height*200/667;
this.balloonDirection = false;
*/
}
HelpView.prototype.clearCanvas = function () {
this.context.clearRect(0, 0, this.width, this.height);
};
HelpView.prototype.drawHelpScreen = function (gameMode) {
if (gameMode == 1) {
this.context.drawImage(this.helpScreen1, 0, 0, this.width, this.height);
}
else {
this.context.drawImage(this.helpScreen2, 0, 0, this.width, this.height);
}
};
HelpView.prototype.render = function (gameMode) {
this.drawHelpScreen(gameMode);
};
return HelpView;
}());
Game.HelpView = HelpView;
})(Game || (Game = {}));
var Game;
(function (Game) {
var Model = (function () {
function Model() {
this.chosenCategories = [];
this.playedWords = [];
this.recentlyUsedWords = [];
this.correctPlayedWords = [];
this.generateItems();
this.gameOver = false;
}
Model.prototype.clearVariables = function () {
this.changeWord();
this.gameOver = false;
this.newItem = false;
this.gameStarted = false;
while (this.playedWords.length > 0) {
this.playedWords.pop();
this.correctPlayedWords.pop();
}
};
Model.prototype.generateItems = function () {
//VERY IMPORTANT: FIRST ELEMENT IN EACH CATEGORY IS THE NAME OF THE CATEGORY, DO NOT PRINT IT
this.Categories =
[
/* 0: College Teams*/ ["College Teams", "Florida Gators", "LSU Tigers", "Tenessee Volunteers", "Georgia Bulldogs", "Oregon Ducks", "Florida State Seminoles", "Arkansas Razorbacks",
"Alabama Crimson Tide", "South Carolina Gamecocks", "Ole Miss Rebels", "Kentucky Wildcats", "Texas A&M Aggies", "Michigan Wolverines", "Michigan State Spartans",
"Texas Longhorns", "Ohio State Buckeyes", "Notre Dame FIghting Irish", "Duke Blue Devils", "Nebraska Cornhuskers", "TCU Horned Frogs"],
/* 1: dances*/ ["Dances", "Macarena", "Teach me how to dougie", "Cat Daddy", "Cha Cha Slide", "Cupid Shuffle", "Thriller", "Gangnam Style"],
/* 2: ESPN*/ ["ESPN", "Erin Andrews", "Tim Tebow", "Soccer", "Football", "Baseball", "Softball", "Tennis", "Champion", "Hockey", "Basketball", "College Gameday", "The Gators", "Referee", "Yellow Card", "Red Card", "Goalie", "First Down", "Kicker", "Defense", "Offense", "Punt", "Quarterback", "Michael Jordan", "Sideline", "Cheerleaders", "Halftime Show", "Cleats", "Superbowl", "National Championship", "3 Strikes You’re Out", "Foul Ball", "Heisman", "Overtime", "Sweat", "Tackle", "Wide Receiver", "Striker", "Scoreboard", "Head Coach", "Conditioning", "Two-a-Days", "Gatorade", "Practice Makes Perfect", "Jersey", "Puck", "Kick Off", "Rain Delay", "Fans", "Underdog", "Comeback", "Undefeated Season", "Marching Band", "Umpire", "Nike", "3-pointer", "Dribble", "Homerun", "Pitcher", "Stadium", "Under Armor", "Dazzlers", "Time Out", "Fantasy Football", "Just Do It", "Get Your Head in the Game", "Rivalry", "Sponsor", "Tie", "Semi-Finals"],
/* 3: Medieval*/ ["Medieval", "Chivalry", "Jousting", "Dark Ages", "Sword in the Stone", "Duke", "Knight", "Renaissance", "Melee", "Gauntlet", "Chalice", "Alms", "Prince", "Queen", "King", "Princess", "Jester", "Feast", "Cannon", "Chainmail", "Goblet", "Armor", "Axe", "Bow", "Arrow", "Duel", "Castle", "Helmet"],
/* 4: NickeloDM*/ ["NickeloDM", "Dancing Lobsters", "Orange Soda", "Penelope", "Totally Kyle", "Crazy Courtney", "The Girls Room", "All That", "Tommy Pickles", "Cynthia & Angelica", "Phil & Lil", "Chuckie", "Football Head", "Helga Patnki", "Orange Blimp", "Slime Time Live", "Ren & Shrimpy", "Keenan & Kel", "Are You Afraid of the Dark?", "Ahh Real Monsters", "Spongebob", "The Amanda Show", "The Wild Thornberries", "Rocket Power", "Cat Dog", "Angry Beavers", "Fairly Odd Parents", "Legends of the Hidden Temple"],
/* 5: Dr. Seuss*/ ["Dr. Seuss", "The Lorax", "Cat in the Hat", "Green Eggs and Ham", "Andy Lou Who", "The Grinch", "Thing 1 and Thing 2", "Truffala Trees", "Fish", "39 and ½ Foot Pole", "Horton", "Theodore Geisel", "Star-bellied Sneetch", "Sam I am", "Max"],
/* 6: Morale Royale*/ ["Morale Royale", "Captain", "Karaoke", "Royal Caribbean", "Carnival", "Buffet", "Casino", "Pool Deck", "Formal Night", "Anchor", "Port", "Dock", "Excursion", "Cabin", "Stateroom", "Putt-Putt Golf", "Life Vest", "Titanic", "Comedy Show", "Beach", "Towel", "Swimsuit", "Sunglasses", "Sunscreen", "Spa", "Massage", "Jacuzzi", "Night Club", "Newlyweds", "Vacation", "Bahamas", "Cazumel", "Hair Braiding", "Kids Club", "Tourists", "Sandals", "Soft Serve Ice Cream"],
/* 7: Dance ‘Merica*/ ["Dance 'Merica", "Statue of Liberty", "Bald Eagle", "American Flag", "Fireworks", "Obama", "Golden Retriever", "Football", "Baseball", "BBQ", "Mount Rushmore", "Hot Dog", "Frat", "Miss America", "Shucking Corn", "McDonalds", "Jorts", "Oprah", "George Washington", "Beyonce", "Thanksgiving", "4th of July", "Black Friday", "Pearl Harbor", "Great Depression", "Civil War", "Prohibition", "Michael Jackson", "Forrest Gump", "United States", "Louis and Clark", "Sacagawea", "White House", "Grand Canyon", "Niagra Falls", "Declaration of Independence", "Martin Luther King Jr", "Secret Service", "The Kennedys", "NYPD", "FBI", "CIA", "Coca Cola", "New York", "Washington D.C."],
/* 8: DM Restaurants*/ ["DM Restaurants", "PDQ", "Chipotle", "Zaxby's", "Chick-fil-a", "Dominos", "Mcdonalds", "Moes", "Yogurtology", "Sweet Dreams", "Vellos", "Panda Express", "Texas Roadhouse", "The Gelato Company", "IHOP", "Burrito Famous!", "Relish", "Pita Pit", "4 Rivers"],
/*9: Kids' Games*/ ["Kids' Games", "Tag", "Hopscotch", "Hide and Seek", "Catch", "Jump-rope", "4 Square", "Corn Hole", "Kickball", "Tetherball", "Cops and Robbers", "Red Rover", "Wiffle Ball", "Ring Around the Rosie", "Red Light Green Light", "Simon Says"],
/*10: Sponsors*/ ["DM Sponsors", "Kiss 105.3 FM", "1 Greek Store", "StateFarm", "IFC", "Yogurtology", "Kaplan", "Alley Gatorz", "Tropical Smoothie", "The Independent Florida Alligator", "The Odyssey", "Pink Narcissus", "UBER"],
/*11: Toy Story*/ ["Toy Story", "", "Woody", "Buzz Lightyear", "Pizza Planet", "You've Got a Friend in Me", "To Infinity and Beyond", "Mr Potato Head", "Mrs. Potato Head", "Spike", "Jessie", "Slinky Dog", "Andy", "Rex", "Sid", "Hamm"],
/*12: Impressions*/ ["Impressions", "Christopher Walken", "Sylvester Stalone", "Arnold Schwarzenegger", "Taylor Swift", "Kanye West", "Mickey Mouse", "Iggie Azalea", "Richard Simmons", "Dolly Parton", "Harry Potter", "Tim Tebow", "Dr. Phil", "George W Bush", "Barack Obama", "Oprah", "Spongebob Squarepants", "Porky Pig", "Forest Gump", "Elmo", "Jersey Shore"],
/*13: Cruise*/ ["Cruise", "Bahamas", "Ice Cream", "Sunburn", "Cabin", "Sea sick", "Mustard drill", "Bingo", "Super Slide ", "24 hour pizza", "Hot tub", "Port of call", "Buffet", "Karaoke", "Belly Flop", "Casino", "Ship Captain ", "Titanic", "Towel Animals", "Sunscreen", "Sunglasses", "Swimming Pool", "Hula Dancing ", "Bathing Suit", "Fish", "Mexico", "Ship Wreck", "Life Boat", "Carnival", "Spa", "Tanning", "Life Guard", "Beach", "Waves", "Hawaiian shirt ", "Old People", "flip flops"],
/*14: Animals*/ ["Animals", "Elephant", "Dog", "Giraffe", "Cat", "Fish", "Dolphin", "Bird", "Anteater ", "Walrus", "Lion", "Tiger", "Bear", "Chinchilla", "Gorilla", "Monkey", "Hampster", "Kangaroo", "Snail", "Sloth", "Lobster", "Caterpiller", "Rabbit", "Jellyfish ", "Ladybug", "Butterfly", "Shark", "Cow", "Sheep", "Pig", "Leech", "Goat", "Bee", "Mouse", "Owl", "Squirrel", "Peacock", "Chicken", "Turkey ", "Otter", "Penguin", "Iguana ", "Alligator", "Parrot ", "Platypus", "Hippo", "Donkey", "Turtle", "Chameleon", "Slug", "Inchworm ", "Butterfly", "Porcupine"],
/*15: Superheroes*/ ["Superheroes", "Superman", "Batman", "Spider-Man", "The Green Lantern", "Quick Silver", "Wolverine", "Cyclops", "Wonder woman", "Bat-mobile", "Catwoman", "Daredevil", "Green Arrow", "The Hulk", "Iron Man", "Black Widow", "Hawkeye", "The Thing", "Human Torch", "Mr. Fantastic", "Invisible Woman", "Silver Surfer", "Thor", "Loki", "Captain America", "Beast Boy", "Aquaman", "Mermaid Man & Barnacle Boy", "Captain Planet", "Chuck Norris", "Deadpool", "Rorschach", "Elastigirl", "Mr. Incredible", "Starlord", "Groot", "Dr. Who", "Hancock"],
/*16: Blockbusters*/ ["Blockbusters", "Titanic", "Frozen", "Finding Nemo", "The Emperor's New Groove", "The Interview", "Avatar", "The Matrix", "Shawshank Redemption", "Gone Girl", "The Godfather ", "Toy Story ", "Jurassic Park", "Star Wars", "Jaws", "Indiana Jones", "Lord of the Rings", "King Kong", "Rocky", "Harry Potter", "Twilight", "Twister", "The Hunger Games", "James Bond", "Pirates of the Caribbean ", "Terminator", "Ghost Busters", "Home Alone", "E.T.", "The Sound of Music", "Men in Black", "The Exorcist", "Shrek", "The Lion King", "Forrest Gump", "Independence Day", "The Sixth Sense", "Nightmare on Elm Street", "Friday the 13th", "Halloween", "Monster's Inc.", "Despicable Me", "Aladdin", "The Graduate", "Transformers", "Interstellar", "Planet of the Apes"],
/*17: Pop Culture*/ ["Pop Culture", "Taylor Swift", "Miley Cyrus", "The Jonas Brothers", "One Direction", "Lana Del Rey", "Lady Gaga", "Katy Perry", "Left Shark", "Snoop Lion", "Mumford and Sons", "Call Me Maybe", "House of Cards", "Breaking Bad", "Better Call Saul", "Game of Thrones", "Orange is the New Black", "Snapchat", "Maroon 5", "Uptown Funk", "Bruno Mars", "Ed Sheeran", "Ellie Goulding", "Rhianna", "Kanye West", "Paul McCartney", "The Weeknd", "Ariana Grande", "Hozier", "Pitbull ", "Usher", "2pac", "Benedict Cumberbatch ", "Megan Trainor", "Sam Smith", "Fallout Boy", "Kelly Clarkson", "Seth Rogan", "Chris Brown", "Big Sean", "James Franco", "Kim Jong-un", "Zed", "Selena Gomez", "Calvin Harris", "Perfect Pitch"],
/*18: Technology*/ ["Technology", "iPhone", "Google Glass", "Virtual Reality", "Xbox", "Playstation", "Wii", "iWatch", "USB", "GoPro", "Kinect", "FaceTime", "Skype", "Soundboard", "Google Fiber", "Linux", "PC", "Mac", "Kindle", "Artificial Intelligence", "Robot", "Netflix"],
/*19: Video Games*/ ["Video Games", "Super Mario Bros.", "Call of Duty", "Super Smash Brothers", "The Sims", "Minecraft", "Runescape", "Destiny ", "Assassin's Creed", "Bioshock", "Starcraft", "Skyrim", "Civilization", "League of Legends", "Dota", "Halo", "Battlefield", "Dragon Age", "Fable", "Shadow of Mordor", "World of Warcraft", "Flappy Bird", "Angry Birds", "Fruit Ninja", "Words With Friends", "Heads Up!", "Clash of Clans", "Temple Run", "Pokemon", "Zelda", "Dance Dance Revolution", "Candy Crush", "Trivia Crack", "Cut the Rope!", "Animal Crossing", "Star Wars Battlefront", "Final Fantasy", "Kingdom Hearts", "Solitaire", "Minesweeper", "Guitar Hero", "Rock Band", "Madden", "NBA2K15"],
/*20: Sci Fi*/ ["Sci Fi", "Light Saber", "C3PO", "Time Travel", "Star Trek", "Warp Drive", "Aliens", "UFO", "Hoverboard", "Black Hole", "Laser Gun", "Spaceship", "Immortality", "The Singularity", "SkyNet"],
/*21: Children's Stories*/ ["Children's Stories", "Humpty Dumpty", "Little Red Riding Hood", "Cinderella", "Goldie Locks", "Clifford the Big Red Dog", "Miss Muffet", "Tortoise and the Hare", "Pinocchio", "The Ant and the Grasshopper", "Cinderella"],
];
for (var i = 0; i != this.Categories.length; ++i) {
this.chosenCategories[i] = true;
}
};
Model.prototype.changeWord = function () {
var currentCategory = this.randomUsableCategory();
this.currentWordCategory = currentCategory;
this.currentItem = this.randomWordInCategory(currentCategory); //category, phrase in category
for (var i = 0; i < this.recentlyUsedWords.length; ++i) {
if (this.recentlyUsedWords[i]) {
if (this.currentItem == this.recentlyUsedWords[i]) {
this.changeWord();
break;
}
}
else {
console.log("game.recentlyUsedWords[i] not found");
}
if (this.recentlyUsedWords.length >= this.numberOfActivePhrases()) {
while (this.recentlyUsedWords.length != 0) {
this.recentlyUsedWords.pop();
}
}
}
};
Model.prototype.numberOfActiveCategories = function () {
var count = 0;
for (var i = 0; i != this.chosenCategories.length; ++i) {
if (this.chosenCategories[i]) {
++count;
}
}
return count;
};
Model.prototype.numberOfActivePhrases = function () {
var count = 0;
for (var i = 0; i != this.chosenCategories.length; ++i) {
if (this.chosenCategories[i]) {
count += (this.Categories[i].length - 1); // -1 is for first element which is name of category
}
}
return count;
};
Model.prototype.randomUsableCategory = function () {
var usableCategories = 0;
for (var i = 0; i != this.chosenCategories.length; ++i) {
if (this.chosenCategories[i] == true) {
++usableCategories;
}
}
//generate random number from 0 to usableCategories -1
if (usableCategories > 0) {
var returnCategory = 0;
var categoryToUse = Math.floor((Math.random() * usableCategories)); //note: this is OF the usable categories, still need to skip unusable categories
console.log("category#: " + categoryToUse);
var i = 0;
do {
if (this.chosenCategories[i] == false) {
++categoryToUse; // increments forloop check as it encounters an unused category
}
++i;
} while (i <= categoryToUse);
return categoryToUse; //is an int
}
};
Model.prototype.gameCanStart = function () {
for (var i = 0; i != this.chosenCategories.length; ++i) {
if (this.chosenCategories[i] == true) {
console.log(i);
return true;
}
}
return false;
};
Model.prototype.changeChosenCat = function (i) {
if (i < this.chosenCategories.length) {
if (this.chosenCategories[i]) {
this.chosenCategories[i] = false;
}
else {
this.chosenCategories[i] = true;
}
}
};
Model.prototype.randomWordInCategory = function (currentCategory) {
var sizeOfCategory = this.Categories[currentCategory].length;
var currentItemNumber = Math.floor((Math.random() * (sizeOfCategory - 1))) + 1; //location in select category of used word, should not be 0 because of category name
return this.Categories[currentCategory][currentItemNumber];
};
return Model;
}());
Game.Model = Model;
})(Game || (Game = {}));
/// <reference path="GameView.ts" />
var Game;
(function (Game) {
var GameTwo = (function (_super) {
__extends(GameTwo, _super);
function GameTwo() {
_super.call(this);
this.gameStarted = false;
this.changeWord();
this.activeTeam = 1;
this.teamOneTimeLeft = 30;
this.teamTwoTimeLeft = 30;
this.teamOneScore = 0;
this.teamTwoScore = 0;
this.currentRound = 0;
this.inBetweenRounds = false;
this.totalRoundsOption = [1, 3, 5, 7, 9];
this.totalRoundsOptionNumber = 0;
this.totalRounds = this.totalRoundsOption[this.totalRoundsOptionNumber];
}
GameTwo.prototype.clearVariables = function () {
_super.prototype.clearVariables.call(this);
this.playingGame = false;
this.activeTeam = 1;
this.currentRound = 0;
this.inBetweenRounds = false;
this.teamOneTimeLeft = 30;
this.teamTwoTimeLeft = 30;
this.teamOneTotalTime = 0;
this.teamTwoTotalTime = 0;
this.teamOneScore = 0;
this.teamTwoScore = 0;
this.totalRoundsOptionNumber = 0;
this.teamOneTotalTime = 0;
this.teamTwoTotalTime = 0;
this.totalRounds = this.totalRoundsOption[this.totalRoundsOptionNumber];
};
GameTwo.prototype.setGameView = function (gv) {
this.gameView = gv;
};
GameTwo.prototype.changeActiveTeam = function () {
if (this.activeTeam == 1) {
this.activeTeam = 2;
}
else {
this.activeTeam = 1;
}
this.newItem = true;
};
GameTwo.prototype.changeItem = function () {
this.newItem = true;
};
GameTwo.prototype.clickLeftArrow = function (w, h) {
this.slideRight(w, h);
};
GameTwo.prototype.clickRightArrow = function (w, h) {
this.slideLeft(w, h);
};
GameTwo.prototype.setTotalRounds = function () {
this.totalRounds = this.totalRoundsOption[this.totalRoundsOptionNumber % 5];
};
GameTwo.prototype.beginGame = function (height) {
this.gameView.renderRoundNumber(height / 1.7, (height / 1.7) - (20 * height / 667), (height / 1.7) + (25 * height / 667), this.totalRounds, true, false);
};
GameTwo.prototype.slideLeft = function (width, height) {
if (this.totalRoundsOptionNumber + 1 <= 4) {
this.gameView.slideLeft(this.totalRoundsOption[(this.totalRoundsOptionNumber) % 5], this.totalRoundsOption[(++this.totalRoundsOptionNumber) % 5], width / 2, width + 70, (height / 1.7) - (20 * height / 667), (height / 1.7) + (25 * height / 667));
}
};
GameTwo.prototype.slideRight = function (width, height) {
if (this.totalRoundsOptionNumber - 1 >= 0) {
this.gameView.slideRight(this.totalRoundsOption[(this.totalRoundsOptionNumber) % 5], this.totalRoundsOption[(--this.totalRoundsOptionNumber) % 5], width / 2, -70, (height / 1.7) - (20 * height / 667), (height / 1.7) + (25 * height / 667));
}
};
GameTwo.prototype.selectedRoundNumber = function () {
this.gameView.renderSelectedRoundNumber();
};
GameTwo.prototype.countdown = function () {
this.gameView.renderCountdown();
};
GameTwo.prototype.notEnoughCategories = function () {
this.gameView.renderNotEnoughCategories;
};
GameTwo.prototype.stopBouncingAnimations = function () {
console.log("GameView: " + this.gameView);
clearTimeout(this.gameView.bouncingAnimation);
clearTimeout(this.gameView.slideLeftAnimation);
clearTimeout(this.gameView.slideRightAnimation);
var self = this;
var f = function () {
clearTimeout(self.gameView.bouncingAnimation);
clearTimeout(self.gameView.slideLeftAnimation);
clearTimeout(self.gameView.slideRightAnimation);
};
var test = setTimeout(f, 10);
var test1 = setTimeout(f, 20);
var test2 = setTimeout(f, 30);
/*
if(this.gameView.bouncingAnimation){
clearTimeout(this.gameView.bouncingAnimation);
}
if(this.gameView.slideRightAnimation){
clearTimeout(this.gameView.bouncingAnimation);
}
if(this.gameView.slideLeftAnimation){
clearTimeout(this.gameView.bouncingAnimation);
}*/
};
GameTwo.prototype.startGame = function () {
this.inBetweenRounds = false;
this.playingGame = true;
this.gameStarted = true;
this.teamOneTimeLeft = 30;
this.teamTwoTimeLeft = 30;
this.teamOneTotalTime = 0;
this.teamTwoTotalTime = 0;
this.currentRound++;
this.startGameForEachRound();
};
GameTwo.prototype.startGameForEachRound = function () {
var act;
if (this.activeTeam == 1) {
act = this.teamOneTotalTime;
}
else {
act = this.teamTwoTotalTime;
}
this.gameView.renderCurrentWordTwo(this.currentItem, act, this.activeTeam);
var self = this;
var f = function () { self.startGameForEachRound(); };
this.gameLoop = setTimeout(f, 100);
if (this.teamOneTimeLeft < 0 || this.teamTwoTimeLeft < 0) {
this.gameView.canDrawBalloons = true;
if (this.currentRound == this.totalRounds) {
if (this.teamOneTotalTime > this.teamTwoTotalTime) {
++this.teamTwoScore;
}
else {
++this.teamOneScore;
}
this.playingGame = false;
this.gameOver = true;
this.gameView.renderGameOverTwo(this.teamOneScore, this.teamTwoScore);
}
else {
if (this.teamOneTotalTime > this.teamTwoTotalTime) {
++this.teamTwoScore;
}
else {
++this.teamOneScore;
}
this.playedWords.push(this.currentItem);
this.changeWord();
this.playingGame = false;
this.inBetweenRounds = true;
this.gameView.renderInBetweenRounds(this.teamOneScore, this.teamTwoScore, this.currentRound, this.totalRounds);
}
clearTimeout(this.gameLoop);
}
if (this.newItem) {
this.playedWords.push(this.currentItem);
this.changeWord();
this.newItem = false;
}
if (this.activeTeam == 1) {
this.teamOneTotalTime += .1;
this.teamOneTimeLeft -= .1;
}
else {
this.teamTwoTotalTime += .1;
this.teamTwoTimeLeft -= .1;
}
};
GameTwo.prototype.endGame = function () {
if (this.gameLoop) {
clearTimeout(this.gameLoop);
}
};
return GameTwo;
}(Game.Model));
Game.GameTwo = GameTwo;
})(Game || (Game = {}));
/// <reference path="Model.ts" />
/// <reference path="GameOne.ts" />
/// <reference path="GameTwo.ts" />
var Game;
(function (Game) {
var GameView = (function () {
function GameView(resources, context, width, height, model) {
this.resources = resources;
this.nextRoundButton = this.resources.nextRoundButton;
this.game_background = this.resources.game_background;
this.game_background2 = this.resources.game_background2;
this.forehead = this.resources.forehead;
this.pass = this.resources.pass;
this.roundPicking = this.resources.roundPicking;
this.correct = this.resources.correct;
this.endGame_background = this.resources.endGame_background;
this.rightArrow = this.resources.rightArrow;
this.leftArrow = this.resources.leftArrow;
this.rightArrowPressed = this.resources.rightArrowPressed;
this.leftArrowPressed = this.resources.leftArrowPressed;
this.balloon = this.resources.balloon;
this.context = context;
this.width = width;
this.height = height;
this.model = model;
this.startingHeight = 0;
}
GameView.prototype.renderForehead = function () {
this.context.drawImage(this.forehead, 0, 0, this.width, this.height);
};
GameView.prototype.renderCountdown = function (timeLeft, height, counter) {
this.clearCanvas();
this.context.drawImage(this.game_background, 0, 0, this.width, this.height);
this.drawNumber(timeLeft);
var self = this;
var timeout;
this.drawCurveyBalloon(height, counter);
if (timeLeft <= 0) {
clearTimeout(timeout);
this.model.canChange = true;
}
else {
height -= 3;
counter += 1;
var f = function () { self.renderCountdown(timeLeft - .01, height, counter); };
timeout = setTimeout(f, 10);
}
};
GameView.prototype.drawCurveyBalloon = function (height, counter) {
var balloonHeight = 200 * this.height / 667;
var balloonWidth = 190 * this.width / 375;
var w = 50 * (Math.sin(counter * .02)) + 10;
this.context.drawImage(this.balloon, w, height, balloonWidth, balloonHeight);
};
GameView.prototype.drawMenuTextHorizontal = function () {
this.rotateContext();
this.context.font = "30px AG Book Rounded";
this.context.textBaseline = 'bottom';
this.context.textAlign = 'left';
this.context.fillStyle = 'blue';
this.context.fillText("< Menu", -140 * this.width / 375, 65 * this.height / 667);
this.context.restore();
};
GameView.prototype.drawMenuTextVertical = function () {
this.context.font = "30px AG Book Rounded";
this.context.textBaseline = 'bottom';
this.context.textAlign = 'left';
this.context.fillStyle = 'black';
this.context.fillText("< Menu", 30 * this.width / 375, 60 * this.height / 667);
};
GameView.prototype.drawNumber = function (timeLeft) {
this.rotateContext();
this.context.font = "bold 80px AG Book Rounded";
this.context.textBaseline = 'middle';
this.context.textAlign = 'center';
this.context.fillStyle = 'white';
timeLeft = Math.floor(timeLeft);
if (timeLeft == -1) {
timeLeft = 0;
}
this.context.fillText(timeLeft, this.width / 2, this.height / 2.4);
this.context.restore();
};
GameView.prototype.renderPass = function () {
this.context.drawImage(this.pass, 0, 0, this.width, this.height);
};
GameView.prototype.renderCorrect = function () {
this.context.drawImage(this.correct, 0, 0, this.width, this.height);
};
GameView.prototype.renderCurrentWordOne = function (currword, currTime) {
this.clearCanvas();
currTime = Math.round(currTime);
this.context.drawImage(this.game_background, 0, 0, this.width, this.height);
this.drawMenuTextHorizontal();
this.printWord(currword);
this.printTime(currTime);
};
GameView.prototype.renderCurrentWordTwo = function (currWord, teamTime, activeTeam) {
this.clearCanvas();
teamTime = Math.floor(teamTime);
this.context.drawImage(this.game_background2, 0, 0, this.width, this.height);
this.drawMenuTextHorizontal();
this.printWord(currWord);
this.printTimeTwo(teamTime, activeTeam);
};
GameView.prototype.balloonAnimation = function (print, h1, h2, h3, s1, s2, s3, count, image, drawMenu, inBetweenRounds) {
var balloon_height = 100 / 667 * this.height;
var balloon_width = 95 / 375 * this.width;
var w1 = 30 / 375 * this.width;
var w2 = 160 / 375 * this.width;
var w3 = 300 / 375 * this.width;
var t;
if (this.balloonsInvisible(h1, h2, h3) || count == 0) {
if (this.whichOneInvisible(h1, h2, h3) == 1) {
h1 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s1 = Math.floor((Math.random() * 9) + 4);
}
if (this.whichOneInvisible(h1, h2, h3) == 2) {
h2 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s2 = Math.floor((Math.random() * 9) + 4);
}
if (this.whichOneInvisible(h1, h2, h3) == 3) {
h3 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s3 = Math.floor((Math.random() * 9) + 4);
}
else if (count == 0) {
h1 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s1 = Math.floor((Math.random() * 9) + 4);
h2 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s2 = Math.floor((Math.random() * 9) + 4);
h3 = Math.floor((Math.random() * this.height + balloon_height + 50) + this.height);
s3 = Math.floor((Math.random() * 9) + 4);
}
}
if (this.canIDrawBalloons()) {
this.clearCanvas();
this.context.drawImage(image, 0, 0, this.width, this.height);
if (inBetweenRounds) {
this.context.drawImage(this.nextRoundButton, this.width - 330 * this.width / 375, this.height - 100 * this.height / 667, 275 * this.width / 375, 100 * this.height / 667);
}
this.context.drawImage(this.balloon, w1, h1, balloon_width, balloon_height);
this.context.drawImage(this.balloon, w2, h2, balloon_width, balloon_height);
this.context.drawImage(this.balloon, w3, h3, balloon_width, balloon_height);
if (drawMenu) {
this.drawMenuTextVertical();
}
print();
h1 -= s1;
h2 -= s2;
h3 -= s3;
var self = this;
var hm = function () { self.balloonAnimation(print, h1, h2, h3, s1, s2, s3, ++count, image, drawMenu, inBetweenRounds); };
t = setTimeout(hm, 1000 / 60);
}
else {
clearTimeout(t);
}
};
GameView.prototype.canIDrawBalloons = function () {
if (this.model instanceof Game.GameOne) {
return (this.model.gameOver);
}
else {
return (this.model.gameOver || this.model.inBetweenRounds);
}
};
GameView.prototype.whichOneInvisible = function (h1, h2, h3) {
var balloon_height = 100 / 667 * this.height;
if (h1 < -balloon_height) {
return 1;
}
if (h2 < -balloon_height) {
return 2;
}
if (h3 < -balloon_height) {
return 3;
}
};
GameView.prototype.balloonsInvisible = function (h1, h2, h3) {
var balloon_height = 100 / 667 * this.height;
return (h1 < -balloon_height || h2 < -balloon_height || h3 < -balloon_height);
};
GameView.prototype.renderInBetweenRounds = function (teamOneScore, teamTwoScore, currentRound, totalRounds) {
this.clearCanvas();
var self = this;
var f = function () { self.printRounds(teamOneScore, teamTwoScore, currentRound, totalRounds); };
this.balloonAnimation(f, 0, 0, 0, 0, 0, 0, 0, this.game_background, true, true);
};
GameView.prototype.printRounds = function (teamOneScore, teamTwoScore, currentRound, totalRounds) {
this.context.font = "50px AG Book Rounded";
this.context.textBaseline = 'center';
this.context.textAlign = 'center';
this.context.fillStyle = "blue";
this.context.fillText("ROUND " + currentRound + "/" + totalRounds, this.width / 2, this.height / 4);
this.context.font = "40px AG Book Rounded";
this.context.fillText("Team 1", this.width / 4, this.height / 2);
this.context.fillText("Team 2", 3 * this.width / 4, this.height / 2);
this.context.fillText(teamOneScore, this.width / 4, this.height / 1.8);
this.context.fillText(teamTwoScore, 3 * this.width / 4, this.height / 1.8);
};
GameView.prototype.renderRoundNumber = function (height, top, bottom, rounds, up) {
this.inMenu = false;
this.context.drawImage(this.roundPicking, 0, 0, this.width, this.height);
this.renderRoundNumber1(height, top, bottom, rounds, up);
};
GameView.prototype.renderRoundNumber1 = function (height, top, bottom, rounds, up) {
var self = this;
this.clearCanvas();
this.bouncingHeight = height;
var self = this;
if (up) {
--height;
}
else {
++height;
}
if (height > bottom) {
up = true;
}
else if (height < top) {
up = false;
}
var f = function () { self.renderRoundNumber1(height, top, bottom, rounds, up); };
if (!this.inMenu) {
this.bouncingAnimation = setTimeout(f, 20);
}
else {
this.clearT();
}
this.context.drawImage(self.roundPicking, 0, 0, self.width, self.height);
this.context.drawImage(this.rightArrow, 13.5 * this.width / 20, this.height / 2.5, 100 / 375 * this.width, 100 / 667 * this.height);
this.context.drawImage(this.leftArrow, this.width / 20, this.height / 2.5, 100 / 375 * this.width, 100 / 667 * this.height);
this.drawMenuTextVertical();
this.context.font = "150px AG Book Rounded";
if (rounds == "11") {
this.context.font = "130px AG Book Rounded";
}
this.context.textBaseline = 'center';
this.context.textAlign = 'center';
this.context.fillStyle = "black";
this.context.fillText(rounds, this.width / 2, height);
};
GameView.prototype.clickLeftArrow = function (currTime) {
};
GameView.prototype.clickRightArrow = function () {
};
GameView.prototype.slideLeft = function (rounds1, rounds2, width1, width2, top, bottom) {
this.clearCanvas();
var self = this;
this.context.drawImage(self.roundPicking, 0, 0, this.width, this.height);
width1 -= 5;
width2 -= 5;
clearTimeout(this.bouncingAnimation);
var f = function () { self.slideLeft(rounds1, rounds2, width1, width2, top, bottom); };
this.slideLeftAnimation = setTimeout(f, 5);
if (this.inMenu) {
clearTimeout(this.slideLeftAnimation);
}
if (width2 <= Math.round(this.width / 2)) {
clearTimeout(this.slideLeftAnimation);
this.renderRoundNumber1(this.bouncingHeight, top, bottom, rounds2, true);
}
this.context.font = "150px AG Book Rounded";
if (rounds1 == "11") {
this.context.font = "130px AG Book Rounded";
}
this.context.textBaseline = 'center';
this.context.textAlign = 'center';
this.context.fillText(rounds1, width1, this.bouncingHeight);
this.context.font = "150px AG Book Rounded";
if (rounds2 == "11") {
this.context.font = "130px AG Book Rounded";