- Timestamp:
- Nov 8, 2012, 10:58:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/soundEffects/src/modules/portals/PortalEndPoint.cc
r8767 r9437 28 28 29 29 #include "PortalEndPoint.h" 30 #include "portals/PortalLink.h" 30 31 31 32 #include <ctime> … … 35 36 36 37 #include "worldentities/MobileEntity.h" 37 38 38 #include "objects/triggers/MultiTriggerContainer.h" 39 39 40 #include " portals/PortalLink.h"40 #include "sound/WorldSound.h" 41 41 42 42 namespace orxonox … … 59 59 this->setRadarObjectShape(RadarViewable::Dot); 60 60 this->setRadarVisibility(true); 61 if( GameMode::isMaster() ) 62 { 63 this->portalSound_ = new WorldSound(this); 64 this->portalSound_->setLooping(false); 65 this->attach(this->portalSound_); 66 this->portalSound_->setSource("sounds/Weapon_HsW01.ogg"); //TODO: change sound file 67 } 61 68 } 62 69 63 70 PortalEndPoint::~PortalEndPoint() 64 71 { 65 if(this->isInitialized() && this->trigger_ != NULL) 66 delete this->trigger_; 72 if (this->isInitialized()) 73 { 74 if (this->portalSound_ != NULL) 75 this->portalSound_->destroy(); 76 77 if (this->trigger_ != NULL) 78 delete this->trigger_; 79 } 67 80 } 68 81 … … 158 171 entity->rotate(this->getWorldOrientation()); 159 172 entity->setVelocity(this->getWorldOrientation() * entity->getVelocity()); 173 //play Sound 174 if( this->portalSound_ && !(this->portalSound_->isPlaying())) 175 { 176 this->portalSound_->play(); 177 } 160 178 } 161 179
Note: See TracChangeset
for help on using the changeset viewer.