Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2009, 3:52:28 PM (14 years ago)
Author:
youngk
Message:

Implemented Firing sounds in Weapons HsW01, LightningGun and RocketFire. Engine and Explosion sounds for the Rocket are not yet implemented.
From now on, when creating a new sound for a weapon, just insert "this→setDefaultSound(PATH_TO_FILE)" into the constructor of the weapon.

Sound Files for HsW01 and LightningGun will be available in a couple of minutes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.cc

    r6227 r6245  
    5252        RegisterObject(HsW01);
    5353
    54         this->reloadTime_ = 0.5;
     54        this->reloadTime_ = 0.25;
    5555        this->damage_ = 15;
    5656        this->speed_ = 2500;
     
    6161        this->delayTimer_.stopTimer();
    6262
    63         this->defSndWpnFire_ = new WorldSound(this);
    64         this->defSndWpnFire_->setLooping(false);
    65         this->setDefaultSound("sounds/Weapon_Laser_shrt.ogg");
     63        this->setDefaultSound("sounds/Weapon_HsW01.ogg");
    6664    }
    6765
    6866    HsW01::~HsW01()
    6967    {
    70         if(this->isInitialized())
    71         {
    72             delete this->defSndWpnFire_;
    73         }
    7468    }
    7569
     
    106100    void HsW01::fire()
    107101    {
    108         this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->attach(this->defSndWpnFire_);
    109         this->defSndWpnFire_->play();
    110 
    111102        this->delayTimer_.startTimer();
    112 
    113         //this->defSndWpnFire_->stop();
    114103    }
    115104
     
    142131        HsW01::muendungsfeuer();
    143132    }
    144 
    145     void HsW01::setDefaultSound(const std::string& soundPath)
    146     {
    147         this->defSndWpnFire_->setSource(soundPath);
    148     }
    149 
    150     const std::string& HsW01::getDefaultSound()
    151     {
    152         return this->defSndWpnFire_->getSource();
    153     }
    154133}
Note: See TracChangeset for help on using the changeset viewer.