-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameover.pde
47 lines (44 loc) · 888 Bytes
/
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
void gameover() {
textAlign(CENTER);
textSize(50);
if (lives == 0) {
fill(truered);
loss.play();
//loss.rewind();
text("GAMEOVER", 400, 300);
textSize(30);
text("Click to Restart!", width/2, 500);
//making it 3
fill(darkblue);
strokeWeight(1);
stroke(darkblue);
rectMode(CORNER);
rect(235, 25, 200, 40);
fill(blue);
textSize(30);
text("0", 245, 50);
} else if (score == 22) {
fill(blue);
textSize(50);
win.play();
text("YOU WIN!", 400, 300);
textSize(30);
text("Click to Play Again!", width/2, 500);
}
}
void gameoverClicks() {
// reset "alive" for briks
int i = 0;
while (i < 22) {
if ((score == 22) || (lives == 0)) {
alive[i] = true;
i = i + 1;
}
}
// reset others
mode = INTRO;
lives = 3;
bx = ballx = width/2;
//ballx = width/2;
bally = 500;
}