-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBell.pde
39 lines (36 loc) · 958 Bytes
/
Bell.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
class Bell {
int BellID;
float BellX, BellY;
float BellWidth, BellHeight;
color BellLitColor;
color BellDimColor;
boolean isLit = false;
boolean isDisplayed = false;
Bell(int id, float xpos, float ypos, float bwidth, float bheight, color c) {
BellID = id; //-------------------------------------------------------ID może okazać się niepotrzebne
BellX = xpos;
BellY = ypos;
BellWidth = bwidth;
BellHeight = bheight;
BellLitColor = c;
BellDimColor = lerpColor(0, c, 0.3);
}
void Display() {
if(isLit) {
fill(BellLitColor);
}
else {
fill(BellDimColor);
}
rect(BellX, BellY, BellWidth, BellHeight);
isDisplayed = true;
}
boolean isMouseOnBell() {
if(mouseX > BellX && mouseX < (BellX + BellWidth) && mouseY > BellY && mouseY < (BellY + BellHeight)) {
return true;
}
else {
return false;
}
}
}