Changeset 6247 for code/branches
- Timestamp:
- Dec 4, 2009, 6:05:39 PM (15 years ago)
- Location:
- code/branches/presentation2/src/modules/weapons/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
r6228 r6247 39 39 #include "worldentities/CameraPosition.h" 40 40 41 #include "sound/WorldSound.h" 42 41 43 namespace orxonox 42 44 { … … 86 88 camPosition->setAllowMouseLook(true); 87 89 this->addCameraPosition(camPosition); 88 } 89 90 /** 91 @brief 92 Destructor. Destroys controller, if present. 90 91 this->defSndWpnEngine_ = new WorldSound(this); 92 this->defSndWpnEngine_->setLooping(true); 93 this->defSndWpnEngine_->setSource("sounds/Rocket_Engine.ogg"); 94 this->attach(defSndWpnEngine_); 95 } 96 97 /** 98 @brief 99 Destructor. Destroys controller, if present and kills sounds, if playing. 93 100 */ 94 101 Rocket::~Rocket() … … 97 104 { 98 105 if (GameMode::isMaster() && this->player_) 106 { 99 107 this->player_->stopTemporaryControl(); 108 } 109 if(this->defSndWpnEngine_->isPlaying()) 110 { 111 this->defSndWpnEngine_->stop(); 112 } 113 delete this->defSndWpnEngine_; 100 114 } 101 115 } … … 117 131 this->player_ = this->owner_->getPlayer(); 118 132 this->owner_->getPlayer()->startTemporaryControl(this); 133 134 this->defSndWpnEngine_->play(); 119 135 } 120 136 … … 185 201 { 186 202 if (GameMode::isMaster()) 203 { 204 if(this->defSndWpnEngine_->isPlaying()) 205 { 206 this->defSndWpnEngine_->stop(); 207 } 187 208 this->destroy(); 209 } 188 210 } 189 211 -
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h
r6167 r6247 122 122 Timer destroyTimer_; 123 123 float lifetime_; 124 125 WorldSound* defSndWpnEngine_; 126 WorldSound* defSndWpnExplosion_; 124 127 }; 125 128
Note: See TracChangeset
for help on using the changeset viewer.