-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameover.pde
65 lines (61 loc) · 1.25 KB
/
gameover.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
void gameover() {
clapping.play();
// left wins
if (leftscore > rightscore) {
clapping.play();
textAlign(CENTER);
textSize(50);
stroke(0);
strokeWeight(1);
text("LEFT PLAYER WINS!", 400, 300);
//making it 3
fill(yellow);
strokeWeight(1);
stroke(yellow);
rect(150, 50, 100, 100);
fill(blue);
textSize(50);
text("3", width/4, 100);
} else {
// right wins
//clapping.rewind();
clapping.play();
//background(red);
textAlign(CENTER);
textSize(80);
//making it 3
fill(yellow);
strokeWeight(1);
stroke(yellow);
rect(550, 50, 100, 100);
fill(red);
textSize(50);
text("3", 3 *width/4, 100);
if (AI == false) {
stroke(0);
strokeWeight(1);
text("RIGHT PLAYER WINS!", 400, 300);
} else {
stroke(0);
strokeWeight(1);
text("COMPUTER WINS!", 400, 300);
}
}
}
void gameoverClicks() {
mode = INTRO;
leftscore = 0;
rightscore = 0;
righty = lefty = 300;
clapping.rewind();
if (mouseX > 550 && mouseY < 750 && mouseY > 650 && mouseY < 750) {
exit();
}
}
void tactileQuit() {
if (mouseX > 550 && mouseY < 750 && mouseY > 650 && mouseY < 750) {
strokeWeight(5);
} else {
strokeWeight(3);
}
}