-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStage1_Functions.pde
93 lines (80 loc) · 2.29 KB
/
Stage1_Functions.pde
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
int width_devilCounter = 105;
int height_devilCounter = 3;
void initStage1(){
initFoodImage();
stage1Timer = new Timer(3600);
noCursor();
medMode=false;
answerIsMade=false;
face = loadImage("stage1img/face.png");
eye = loadImage("stage1img/eye.png");
acneScar = loadImage("stage1img/acneScar.png");
acne0 = loadImage("stage1img/acne0.png");
acne1 = loadImage("stage1img/acne1.png");
acne2 = loadImage("stage1img/acne1.png");
acne3 = loadImage("stage1img/acne1.png");
acne4 = loadImage("stage1img/acne1.png");
acne5 = loadImage("stage1img/acne4.png");
mouthShut = loadImage("stage1img/mouthShut.png");
icon = loadImage("stage1img/finger.png");
icon2 = loadImage("stage1img/finger2.png");
iconShow = icon;
toolKey = loadImage("stage1img/medKey.png");
toolKey2 = loadImage("stage1img/medKey.png");
keyQ = loadImage("stage1img/Q.png");
keyA = loadImage("stage1img/A.png");
keyW = loadImage("stage1img/W.png");
keyS = loadImage("stage1img/S.png");
font = createFont("font/font.ttf", 56);
textFont(font);
acneCounter = 0;
acneList = new Acne[50];
currentSet = new FoodSet();
}
//check icon
void checkIcon(){
if(acneOp){
icon = loadImage("stage1img/crossIcon.png");
icon2 = loadImage("stage1img/crossIcon2.png");
}else if(medMode==true){
icon = loadImage("stage1img/med.png");
icon2 = loadImage("stage1img/med2.png");
}else{
icon = loadImage("stage1img/finger.png");
icon2 = loadImage("stage1img/finger2.png");
}
if(mousePressed!=true){
iconShow=icon;
}
}
void nextFoodSet(){
keyQ = loadImage("stage1img/Q.png");
keyA = loadImage("stage1img/A.png");
keyW = loadImage("stage1img/W.png");
keyS = loadImage("stage1img/S.png");
currentSet = new FoodSet();
devilCounter=0;
answerIsMade=false;
}
void drawDevilTimer(int x,int y){
float devilTime = map(devilCounter,0,180,0,width_devilCounter);
noStroke();
fill(255);
rect(x,y,width_devilCounter,height_devilCounter);
fill(-125006);
rect(x,y,devilTime,height_devilCounter);
}
//Draw eyes functions
float radianTowardsMouse(float x,float y){
float eyeRad = atan2(mouseY-y, mouseX-x);
return eyeRad;
}
int getNumOfAcne(){
int numOfAcne = 0;
for(int i=0;i<acneCounter;i++){
if(acneList[i]!=null){
numOfAcne++;
}
}
return numOfAcne;
}