notes mod fixed
This commit is contained in:
parent
f096594e0e
commit
25a38c6b08
7 changed files with 9 additions and 1 deletions
Binary file not shown.
Binary file not shown.
BIN
Resources/Sounds/NotesMod/3.ogg
Normal file
BIN
Resources/Sounds/NotesMod/3.ogg
Normal file
Binary file not shown.
BIN
Resources/Sounds/NotesMod/4.ogg
Normal file
BIN
Resources/Sounds/NotesMod/4.ogg
Normal file
Binary file not shown.
|
@ -32,7 +32,7 @@ bool Player::event(sf::Event e) {
|
||||||
case (sf::Event::KeyPressed):
|
case (sf::Event::KeyPressed):
|
||||||
if(e.key.code == sf::Keyboard::C) {
|
if(e.key.code == sf::Keyboard::C) {
|
||||||
|
|
||||||
std::string sample = "mod"+std::to_string(rand()%2+1);
|
std::string sample = "mod"+std::to_string(rand()%4+1);
|
||||||
if(!mod) sample = "note"+std::to_string(rand()%4+1);
|
if(!mod) sample = "note"+std::to_string(rand()%4+1);
|
||||||
SoundManager::playSound(sample);
|
SoundManager::playSound(sample);
|
||||||
//std::cout << "playing sample " << sample << std::endl;
|
//std::cout << "playing sample " << sample << std::endl;
|
||||||
|
|
|
@ -49,6 +49,8 @@ sf::SoundBuffer SoundManager::bona7;
|
||||||
sf::SoundBuffer SoundManager::bona8;
|
sf::SoundBuffer SoundManager::bona8;
|
||||||
sf::SoundBuffer SoundManager::mod1;
|
sf::SoundBuffer SoundManager::mod1;
|
||||||
sf::SoundBuffer SoundManager::mod2;
|
sf::SoundBuffer SoundManager::mod2;
|
||||||
|
sf::SoundBuffer SoundManager::mod3;
|
||||||
|
sf::SoundBuffer SoundManager::mod4;
|
||||||
|
|
||||||
std::map<std::string, sf::Sound> SoundManager::soundMap;
|
std::map<std::string, sf::Sound> SoundManager::soundMap;
|
||||||
std::map<std::string, sf::Music> SoundManager::musicMap;
|
std::map<std::string, sf::Music> SoundManager::musicMap;
|
||||||
|
@ -142,6 +144,10 @@ void SoundManager::load(){
|
||||||
soundMap["mod1"].setBuffer(mod1);
|
soundMap["mod1"].setBuffer(mod1);
|
||||||
ASSERT(mod2.loadFromFile(WORK_DIR+"Resources/Sounds/NotesMod/2.ogg"));
|
ASSERT(mod2.loadFromFile(WORK_DIR+"Resources/Sounds/NotesMod/2.ogg"));
|
||||||
soundMap["mod2"].setBuffer(mod2);
|
soundMap["mod2"].setBuffer(mod2);
|
||||||
|
ASSERT(mod3.loadFromFile(WORK_DIR+"Resources/Sounds/NotesMod/3.ogg"));
|
||||||
|
soundMap["mod3"].setBuffer(mod3);
|
||||||
|
ASSERT(mod4.loadFromFile(WORK_DIR+"Resources/Sounds/NotesMod/4.ogg"));
|
||||||
|
soundMap["mod4"].setBuffer(mod4);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,8 @@ class SoundManager {
|
||||||
static sf::SoundBuffer bona8;
|
static sf::SoundBuffer bona8;
|
||||||
static sf::SoundBuffer mod1;
|
static sf::SoundBuffer mod1;
|
||||||
static sf::SoundBuffer mod2;
|
static sf::SoundBuffer mod2;
|
||||||
|
static sf::SoundBuffer mod3;
|
||||||
|
static sf::SoundBuffer mod4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue