Changeset 12356 for code/branches/OrxoBlox_FS19
- Timestamp:
- May 9, 2019, 2:20:32 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12350 r12356 33 33 34 34 #include "OrxoBloxBall.h" 35 #include "OrxoBloxStones.h" 35 36 #include "OrxoBlox.h" 36 37 #include <bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> … … 295 296 296 297 297 void OrxoBloxBall::Bounce(OrxoBloxStones* otherObject) {298 void OrxoBloxBall::Bounce(OrxoBloxStones* Stone) { 298 299 299 300 Vector3 velocity = this->getVelocity(); 300 Vector3 position OtherObject = otherObject->getPosition();301 Vector3 positionStone = Stone->getPosition(); 301 302 Vector3 myPosition = this->getPosition(); 302 303 orxout() << "About to Bounce >D" << endl; … … 306 307 //else { 307 308 308 int distance_X = myPosition.x - position OtherObject.x;309 int distance_Z = myPosition.z - position OtherObject.z;309 int distance_X = myPosition.x - positionStone.x; 310 int distance_Z = myPosition.z - positionStone.z; 310 311 311 312 if (distance_X < 0) … … 336 337 337 338 338 void OrxoBloxBall::Collides(OrxoBloxStones* otherObject)339 { 340 341 if( otherObject== nullptr)339 void OrxoBloxBall::Collides(OrxoBloxStones* Stone) 340 { 341 342 if(Stone == nullptr) 342 343 return; 343 344 344 345 orxout() << "About to Bounce >D" << endl; 345 Bounce(otherObject); 346 Bounce(Stone); 347 //if(otherObject->getHealth() <= 0) { 348 Stone->destroy(); 349 //} 350 //otherObject->reduceHealth(); 346 351 } 347 352 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
r12349 r12356 135 135 const std::string& getDefBoundarySound(); 136 136 137 unsigned int getHealth(); 138 137 139 private: 138 140 void registerVariables(); … … 151 153 WorldSound* defBoundarySound_; 152 154 OrxoBlox* orxoblox_; 153 154 155 }; 155 156 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc
r12342 r12356 21 21 this->delay_ = false; 22 22 } 23 24 unsigned int OrxoBloxStones::getHealth() { 25 return this->health_; 26 } 27 28 void OrxoBloxStones::reduceHealth() { 29 this->health_ -= 1; 30 } 23 31 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h
r12331 r12356 63 63 void setGame(OrxoBlox* orxoblox) 64 64 { assert(orxoblox); orxoblox_ = orxoblox; } 65 66 unsigned int getHealth(); 67 68 void reduceHealth(); 65 69 66 70 private:
Note: See TracChangeset
for help on using the changeset viewer.