-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio.h
84 lines (71 loc) · 1.78 KB
/
audio.h
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
77
78
79
80
81
82
83
84
//Implementa as coisas reltivas ao audio
#ifndef AUDIO_H
#define AUDIO_H
#include <mmsystem.h>
bool startGame = false;
bool gameOverAudio = false;
bool gameWinAudio = false;
bool gameMenuAudio = true;
bool explosion = false;
bool atiraAudio = false;
bool audioLife = false;
bool audioApareceBonus = false;
bool audioPegaBonus = false;
bool audioHitMetal = false;
void playAudio(){
if(startGame == false){
mciSendString("play sounds/gamestart.wav", NULL, 0, NULL);
startGame = true;
}
if(audioLife){
mciSendString("play sounds/life.wav", NULL, 0, NULL);
audioLife = false;
audioPegaBonus = false;
}
if(audioHitMetal){
mciSendString("play sounds/hitMetal.wav", NULL, 0, NULL);
audioHitMetal = false;
}
if(audioPegaBonus){
mciSendString("play sounds/pegaBonus.wav", NULL, 0, NULL);
audioPegaBonus = false;
}
if(audioApareceBonus){
mciSendString("play sounds/bonusAparecendo.wav", NULL, 0, NULL);
audioApareceBonus = false;
}
if(gameOverAudio){
mciSendString("play sounds/gameover.wav", NULL, 0, NULL);
gameOverAudio = false;
}
if(explosion){
mciSendString("play sounds/explosion.wav", NULL, 0, NULL);
explosion = false;
}
if(atiraAudio){
mciSendString("play sounds/fire.wav", NULL, 0, NULL);
atiraAudio = false;
}
}
void playGameOverAudio(){
if(gameOverAudio){
mciSendString("play sounds/gameover.wav", NULL, 0, NULL);
gameOverAudio = false;
}
}
void playGameWinAudio(){
if(gameWinAudio){
mciSendString("play sounds/gamewin.wav", NULL, 0, NULL);
gameWinAudio = false;
}
}
void playMenuAudio(){
if(gameMenuAudio){
mciSendString("play sounds/gamemenu.wav", NULL, 0, NULL);
gameMenuAudio = false;
}else {
mciSendString("stop sounds/gamemenu.wav", NULL, 0, NULL);
mciSendString("close sounds/gamemenu.wav", NULL, 0, NULL);
}
}
#endif