-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_over.cpp
42 lines (35 loc) · 1015 Bytes
/
game_over.cpp
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
#include "header.h"
#include "globals.h"
int game_over() {
// message processing loop
bool done = false;
while (!done) {
SDL_Event event;
while (SDL_PollEvent(&event))
{
// check for messages
switch (event.type)
{
// exit if the window is closed
case SDL_QUIT:
done = true;
break;
// check for keypresses
case SDL_KEYDOWN:
{
// exit if ANY PRESSED
done = true;
break;
}
} // end switch
} // end of message processing
print_full_picture(BITMAPS[IMG_ENDSCREEN]);
char temp[80];
SCORE = calculate_score() / 2; // because you hath failed
sprintf(temp,"SCORE: %d",SCORE);
put_text_at(-1,360,temp);
SDL_Flip(MAIN_SCREEN);
SDL_Delay(100);
}
return 0;
}