-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEndMenu.pde
More file actions
executable file
·66 lines (53 loc) · 1.79 KB
/
Copy pathEndMenu.pde
File metadata and controls
executable file
·66 lines (53 loc) · 1.79 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
57
58
59
60
61
62
63
64
65
66
class EndMenu{
//Um... a message and an exit button. That's all this does.
String lastScores;
void draw(){
if(z_key == 1){
z_key++;
gameState = 0;
manager.reset();
}
if(esc_key == 1){
esc_key++;
gameState = 0;
manager.reset();
}
if(gameState == 4){
drawFail();
}else if(gameState == 5){
drawPass();
}
}
void drawFail(){
//Draw stuff
strokeWeight(0);
textAlign(CENTER, CENTER);
textSize(30);
fill(255);
text("Game Over",width/2, 200);
text("You have been slain by the Bullets", width/2, 300);
textSize(15);
text("You survived " + (manager.currentTime - manager.startTime)/1000f + "s\nYour score: " + window.score, width/2, 350);
textAlign(LEFT, BOTTOM);
text("Z to return to the menu", 10, height-10);
textSize(12);
textAlign(RIGHT, BOTTOM);
text(lastScores, width - 10, height - 10);
}
void drawPass(){
//Draw stuff
strokeWeight(0);
textAlign(CENTER, CENTER);
textSize(30);
fill(255);
text("Game Over",width/2, 200);
text("You survived the entire round!", width/2, 300);
textSize(15);
text("Your score: " + window.score, width/2, 350);
textAlign(LEFT, BOTTOM);
text("Z to return to the menu", 10, height-10);
}
void rescore(){ //Gives EndMenu the notification that the scores are about to be changed and that it should update to them first.
lastScores = menu.scoreLines;
}
}