-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelpView.ts
More file actions
98 lines (89 loc) · 2.74 KB
/
HelpView.ts
File metadata and controls
98 lines (89 loc) · 2.74 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
/// <reference path="Resources.ts" />
module Game{
export class HelpView{
resources;
context;
width;
height;
gameMode;
helpScreen1;
helpScreen2;
constructor(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;
*/
}
clearCanvas(){
this.context.clearRect(0, 0, this.width, this.height);
}
drawHelpScreen(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);
}
}
render(gameMode){
this.drawHelpScreen(gameMode);
}
/*
balloonAnimation1(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);
}
}
*/
}
}