mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
using specific SFX for projectiles
a new SFX for torpedos
This commit is contained in:
@@ -7,7 +7,7 @@ projectiles = {
|
||||
size = {x = 1.2, y = 2.7, z = .54},
|
||||
speed = .5,
|
||||
rotAngle = .1,
|
||||
explosion = {damage = 100, radius = 20},
|
||||
explosion = {damage = 100, radius = 20, sfx = PATH .. 'Sounds/SFX/Explosions/explosion02.ogg'},
|
||||
directHitDamage = 450,
|
||||
rayLength = 1.25,
|
||||
name = "Cruise missile",
|
||||
@@ -18,7 +18,7 @@ projectiles = {
|
||||
projectileClass = ProjectileClass.TORPEDO,
|
||||
size = {x = .2, y = 1.6, z = .2},
|
||||
speed = .06,
|
||||
explosion = {damage = 20, radius = 3},
|
||||
explosion = {damage = 20, radius = 3, sfx = PATH .. 'Sounds/Units/Submarines/torpedo.ogg'},
|
||||
directHitDamage = 450,
|
||||
rayLength = .75,
|
||||
name = "Torpedo",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+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