Changeset 5889 for code/branches/core5
- Timestamp:
- Oct 6, 2009, 4:57:53 AM (15 years ago)
- Location:
- code/branches/core5/src/modules/pong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/modules/pong/Pong.cc
r5831 r5889 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/EventIncludes.h" 32 33 #include "core/Executor.h" 33 34 #include "PongCenterpoint.h" … … 39 40 namespace orxonox 40 41 { 42 CreateEventName(PongCenterpoint, right); 43 CreateEventName(PongCenterpoint, left); 44 41 45 CreateUnloadableFactory(Pong); 42 46 … … 155 159 if (this->center_) 156 160 { 157 this->center_->fireEvent(); 158 161 if (player == this->getRightPlayer()) 162 this->center_->fireEvent(EventName(PongCenterpoint, right)); 163 else if (player == this->getLeftPlayer()) 164 this->center_->fireEvent(EventName(PongCenterpoint, left)); 165 159 166 if (player) 160 167 this->gtinfo_->sendAnnounceMessage(player->getName() + " scored"); -
code/branches/core5/src/modules/pong/PongBall.cc
r5885 r5889 102 102 { 103 103 velocity.z = -velocity.z; 104 if (GameMode::playsSound())105 this->sidesound_->play();106 107 104 if (position.z > this->fieldHeight_ / 2) 108 105 position.z = this->fieldHeight_ / 2; 109 106 if (position.z < -this->fieldHeight_ / 2) 110 107 position.z = -this->fieldHeight_ / 2; 108 109 this->fireEvent(); 110 if (GameMode::playsSound()) 111 this->sidesound_->play(); 111 112 } 112 113 … … 125 126 velocity.x = -velocity.x; 126 127 velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_; 128 129 this->fireEvent(); 127 130 if (GameMode::playsSound()) 128 131 this->batsound_->play(); … … 147 150 velocity.x = -velocity.x; 148 151 velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_; 152 153 this->fireEvent(); 149 154 if (GameMode::playsSound()) 150 155 this->batsound_->play();
Note: See TracChangeset
for help on using the changeset viewer.