- Timestamp:
- May 9, 2019, 11:36:28 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12345 r12346 147 147 148 148 // Create the first Wall. 149 this-> LevelUp();149 this->createWall(); 150 150 151 151 //Create Ship … … 213 213 this->createWall(); 214 214 this->activeWalls_.push_back(this->futureWall_); 215 for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) 216 this->stones_.push_back(this->futureWall_->getStone(i)); 215 217 //new location of ship 216 218 //new amount of balls 217 219 //create balls 218 220 //insert new wall 219 220 221 } 221 222 … … 243 244 } 244 245 245 246 OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) { 247 248 orxout() << "Checking for Collision" << endl; 249 Vector3 BallPosition = Ball->getPosition(); 250 for(OrxoBloxStones* someStone : this->stones_) 251 { 252 orxout() << "Checking a stone" << endl; 253 const Vector3& StonePosition = someStone->getPosition(); //!< Saves the position of the currentStone 254 int size = someStone->getSize(); 255 if((BallPosition.x >= StonePosition.x - size && BallPosition.x <= StonePosition.x + size) || 256 (BallPosition.z >= StonePosition.z - size && BallPosition.z <= StonePosition.z + size)) { 257 orxout() << "FOUND ONE" << endl; 258 return someStone; 259 } 260 } 261 orxout() << "Found nothing...." << endl; 262 return nullptr; 263 } 246 264 247 265 }
Note: See TracChangeset
for help on using the changeset viewer.