Changeset 9945 for code/trunk/src/modules/pong
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pong/PongBall.cc
r9939 r9945 147 147 { 148 148 defBoundarySound_->play(); //play boundary sound 149 149 // Its velocity in z-direction is inverted (i.e. it bounces off). 150 150 velocity.z = -velocity.z; 151 151 // And its position is set as to not overstep the boundary it has just crossed. … … 173 173 { 174 174 defBatSound_->play(); //play bat sound 175 175 // Set the ball to be exactly at the boundary. 176 176 position.x = this->fieldWidth_ / 2; 177 177 // Invert its velocity in x-direction (i.e. it bounces off). … … 186 186 else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 187 187 { 188 188 defScoreSound_->play();//play score sound 189 189 if (this->getGametype() && this->bat_[0]) 190 190 { … … 202 202 { 203 203 defBatSound_->play(); //play bat sound 204 204 // Set the ball to be exactly at the boundary. 205 205 position.x = -this->fieldWidth_ / 2; 206 206 // Invert its velocity in x-direction (i.e. it bounces off). … … 215 215 else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 216 216 { 217 217 defScoreSound_->play();//play score sound 218 218 if (this->getGametype() && this->bat_[1]) 219 219 {
Note: See TracChangeset
for help on using the changeset viewer.