mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
using specific SFX for projectiles
a new SFX for torpedos
This commit is contained in:
+2
-5
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user