Changeset 8105 for code/branches/tetris/src/modules/pong/PongBall.cc
- Timestamp:
- Mar 23, 2011, 12:13:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tetris/src/modules/pong/PongBall.cc
r8104 r8105 101 101 @brief 102 102 Is called every tick. 103 //TODO: Explain in detail what happens here.103 Handles the movement of the ball and its interaction with the boundaries and bats. 104 104 @param dt 105 105 The time since the last tick. … … 226 226 /** 227 227 @brief 228 Set the 228 Set the bats for the ball. 229 @param bats 230 An array (of size 2) of weak pointers, to be set as the new bats. 229 231 */ 230 232 void PongBall::setBats(WeakPtr<PongBat>* bats) 231 233 { 232 if (this->bDeleteBats_) 234 if (this->bDeleteBats_) // If there are already some bats, delete them. 233 235 { 234 236 delete[] this->bat_; … … 237 239 238 240 this->bat_ = bats; 241 // Also store their object IDs, for synchronization. 239 242 this->batID_[0] = this->bat_[0]->getObjectID(); 240 243 this->batID_[1] = this->bat_[1]->getObjectID(); 241 244 } 242 245 246 /** 247 @brief 248 Get the bats over the network. 249 */ 243 250 void PongBall::applyBats() 244 251 { 245 if (!this->bat_) 252 // Make space for the bats, if they don't exist, yet. 253 if (this->bat_ == NULL) 246 254 { 247 255 this->bat_ = new WeakPtr<PongBat>[2];
Note: See TracChangeset
for help on using the changeset viewer.