-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMorte.c
76 lines (47 loc) · 1.46 KB
/
Morte.c
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
67
68
69
70
71
72
73
74
75
76
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_mixer.h>
int TelaMorte(SDL_Surface *screen, int EstadoOpcoes[2],int *pontuacao) //int main() //void TelaMorte(SDL_Surface *screen)
{
SDL_Event event;
int quit = 0;
screen = SDL_SetVideoMode(800, 600,16,SDL_HWSURFACE | SDL_DOUBLEBUF);
//Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096);
Figura TelaMorte;
TelaMorte.x = 0;
TelaMorte.y = 0;
TelaMorte.imagem = IMG_Load("Imagens/gameover.png");
Mix_Chunk * SomMorte = Mix_LoadWAV("SonsJogo/risada.wav");
TTF_Font *fonte;
fonte = TTF_OpenFont("japonese.ttf",30);
SDL_Color textColor = { 255, 255, 255 };
Mix_PauseMusic();
Nome_recorde(pontuacao,screen);
if(EstadoOpcoes[0] == 0)
Mix_Volume(-1, 0);
else
Mix_Volume(-1, 128);
Mix_PlayChannel(-1,SomMorte,0);
while(!quit)
{
while (SDL_PollEvent(&event))
{
//if(event.type == SDL_QUIT)
//quit = 1;
if(event.type == SDL_KEYDOWN)
{
if(event.key.keysym.sym == SDLK_ESCAPE)
return -1;
if(event.key.keysym.sym == SDLK_RETURN) //condição para retornar a Tela Inicial
quit = 1;
}
}
//SDL_BlitSurface(TelaMorte,NULL,screen,NULL);
apply_surface(TelaMorte,screen);
desenha_texto("Aperte ENTER para voltar ao menu inicial",screen,100,500,fonte);
SDL_Flip(screen);
}
Mix_FreeChunk(SomMorte);
return 0;
}