-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyPressed.pde
More file actions
56 lines (48 loc) · 1.23 KB
/
KeyPressed.pde
File metadata and controls
56 lines (48 loc) · 1.23 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
void keyPressed() {
if (key == 'h') {
if (helpimg_toggle==0) {
helpimg_toggle=1;
x_helpimg=0; //To display the Help image
if (x_fp==0) {//While displaying the Menu Screen
helpimg=loadImage("images/Help01.jpg");
y_fp=900;
} else {//While playing the game
helpimg=loadImage("images/Help02.jpg");
//Saving the x coordinates in the array - x_temp
for (int i = 1; i <= 16; ++i) {
x_temp[i]=x[i];
}
MoveTilesOutSide();
y_fullimg=900;
x_b01=900;
y_b01=900;
x_b02=900;
y_b02=900;
x_b03=900;
y_b03=900;
x_time=900;
// y_time=900;
}
} else { // if helpimg_toggle==1
helpimg_toggle=0;
x_helpimg=900;
if (x_fp==0) {
y_fp=0;
} else {
//Restoring the x coordinates from the array - x_temp
for (int i = 1; i <= 16; i = i+1) {
x[i]=x_temp[i];
}
y_fullimg=0;
x_time=570;
// y_time=840;
x_b01=5;
y_b01=805;
x_b02=160;
y_b02=805;
x_b03=315;
y_b03=805;
}
}
}
}