-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound.cpp
112 lines (98 loc) · 3.28 KB
/
sound.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "sound.h"
#include "gamebalance.h"
using namespace std;
sf::Sound Sound::sound = sound;
sf::SoundBuffer Sound::soundBuffer = soundBuffer;
sf::Sound Sound::hutriesSound = hutriesSound;
sf::SoundBuffer Sound::hutriesSoundBuffer = hutriesSoundBuffer;
const string Sound::errorPath = "audio/error.flac";
const string Sound::clickPath = "audio/click.flac";
const string Sound::tingPath = "audio/ting.flac";
const string Sound::notificationPath = "audio/notification.flac";
const string Sound::musicPath = "audio/celtic.flac";
const string Sound::hutrie = "audio/sir.flac";
const string Sound::barracks = "audio/barracks.flac";
const string Sound::farm = "audio/farm.flac";
const string Sound::goldmine = "audio/goldmine.flac";
const string Sound::hutrieshall = "audio/castle.flac";
const string Sound::residence = "audio/residence.flac";
const string Sound::sawmill = "audio/saw.flac";
const string Sound::stonecutter = "audio/stonecutter.flac";
const string Sound::trees = "audio/trees.flac";
const string Sound::mountain = "audio/mountain.flac";
const string Sound::rocks = "audio/rocks.flac";
const string Sound::winSound = "audio/winSound.flac";
const string Sound::loseSound = "audio/loseSound.flac";
const string Sound::menuMusic = "audio/intro.flac";
const string Sound::introMusic = "audio/warHorn.flac";
const string Sound::construction = "audio/construction.flac";
const string Sound::purchaseSoundPath = "audio/purchase.flac";
const string Sound::soldierVoicePath = "audio/soldier_voice.flac";
const string Sound::workerVoicePath = "audio/worker_voice.flac";
const string Sound::archerVoicePath = "audio/archer_voice.flac";
const string Sound::carrierVoicePath = "audio/carrier_voice.flac";
const string Sound::reminder = "audio/churchbell.wav";
void Sound::setSoundBuffer()
{
sound.setBuffer(soundBuffer);
}
void Sound::error()
{
Sound::setSoundBuffer();
soundBuffer.loadFromFile(errorPath);
sound.play();
}
void Sound::click()
{
Sound::setSoundBuffer();
soundBuffer.loadFromFile(clickPath);
sound.setVolume(GameBalance::sfxVolume);
sound.play();
}
void Sound::ting()
{
Sound::setSoundBuffer();
soundBuffer.loadFromFile(tingPath);
sound.play();
}
void Sound::purchaseSound()
{
Sound::setSoundBuffer();
soundBuffer.loadFromFile(purchaseSoundPath);
sound.setVolume(GameBalance::sfxVolume);
sound.play();
}
void Sound::soldierSound()
{
hutriesSound.setBuffer(hutriesSoundBuffer);
hutriesSoundBuffer.loadFromFile(soldierVoicePath);
hutriesSound.setVolume(GameBalance::sfxVolume);
hutriesSound.play();
}
void Sound::workerSound()
{
hutriesSound.setBuffer(hutriesSoundBuffer);
hutriesSoundBuffer.loadFromFile(workerVoicePath);
hutriesSound.setVolume(GameBalance::sfxVolume);
hutriesSound.play();
}
void Sound::carrierSound()
{
hutriesSound.setBuffer(hutriesSoundBuffer);
hutriesSoundBuffer.loadFromFile(carrierVoicePath);
hutriesSound.setVolume(GameBalance::sfxVolume);
hutriesSound.play();
}
void Sound::archerSound()
{
hutriesSound.setBuffer(hutriesSoundBuffer);
hutriesSoundBuffer.loadFromFile(archerVoicePath);
hutriesSound.setVolume(GameBalance::sfxVolume);
hutriesSound.play();
}
void Sound::notification()
{
Sound::setSoundBuffer();
soundBuffer.loadFromFile(notificationPath);
sound.play();
}