- Timestamp:
- May 9, 2019, 3:32:40 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12356 r12360 67 67 this->relMercyOffset_ = 0.05f; 68 68 this->orxoblox_ = this->getOrxoBlox(); 69 this->radius_ = 1.5; 69 70 70 71 this->registerVariables(); … … 302 303 Vector3 myPosition = this->getPosition(); 303 304 orxout() << "About to Bounce >D" << endl; 304 //if (positionOtherObject.y < 0) {305 //this.destroy()306 //}S307 //else {308 305 309 306 int distance_X = myPosition.x - positionStone.x; … … 322 319 if (distance_X < distance_Z) { 323 320 velocity.z = -velocity.z; 324 orxout() << "z" << endl; 321 orxout() << "z" << endl; 325 322 } 326 if (distance_Z < distance_X) {323 else if (distance_Z < distance_X) { 327 324 velocity.x = -velocity.x; 328 orxout() << "x" << endl; 325 orxout() << "x" << endl; 329 326 } 330 327 else { … … 332 329 velocity.z = -velocity.z; 333 330 orxout() << "both" << endl; 334 } 331 } 332 335 333 this->setVelocity(velocity); 334 this->setPosition(myPosition); 336 335 } 337 336 … … 346 345 Bounce(Stone); 347 346 //if(otherObject->getHealth() <= 0) { 348 Stone->destroy(); 347 Stone->destroy(); 348 349 349 //} 350 350 //otherObject->reduceHealth(); … … 362 362 } 363 363 364 float OrxoBloxBall::getRadius() { 365 return this->radius_; 366 } 367 364 368 365 369 }
Note: See TracChangeset
for help on using the changeset viewer.