using specific SFX for projectiles

a new SFX for torpedos
This commit is contained in:
devZoGok
2024-01-26 15:12:14 +02:00
parent c8523351fa
commit 213536db2f
5 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -64,12 +64,9 @@ namespace battleship{
}
void Projectile::initSound(){
GameManager *gm = GameManager::getSingleton();
explosionSfxBuffer = new sf::SoundBuffer();
string p2 = gm->getPath() + "Sounds/SFX/Explosions/explosion0" + to_string(rand() % 4) + ".ogg";
if(explosionSfxBuffer->loadFromFile(p2.c_str()))
explosionSfx = new sf::Sound(*explosionSfxBuffer);
string sfxPath = generateView()[GameObject::getGameObjTableName()][id + 1]["explosion"]["sfx"];
explosionSfx = GameObject::prepareSfx(explosionSfxBuffer, sfxPath);
}
void Projectile::update() {