- Timestamp:
- May 11, 2017, 3:18:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBQBlock.cc
r11405 r11416 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Julien Kindle 24 24 * Co-authors: 25 * ...25 * 26 26 * 27 27 */ … … 38 38 #include "SOB.h" 39 39 #include "SOBMushroom.h" 40 #include "SOBCoin.h" 40 41 41 42 namespace orxonox … … 47 48 RegisterObject(SOBQBlock); 48 49 used_ = false; 49 50 // setPosition(Vector3(0,0,0)); 51 // setVelocity(Vector3(0,0,0)); 52 // setAcceleration(Vector3(0,0,0)); 53 // setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 50 54 51 } 55 52 … … 62 59 bool SOBQBlock::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { 63 60 61 62 //If you hit the QBlock, the visibility of all attached objects get inverted! Pretty easy way to create changing blocks :) 64 63 float v_z = otherObject->getVelocity().z; 65 64 if (!used_ && v_z > 50.0) { … … 70 69 71 70 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 71 72 //Spawn either a powerup mushroom or a coin animation (also just an object, have a look at the SOBCoin class) 73 //The spawn methods are declared at the bottom of this file 72 74 if (type_ == "Coin") { 73 75 SOBGame->addCoin(); 76 spawnCoin(); 74 77 } 75 78 if (type_ == "Mushroom") { … … 91 94 92 95 96 //The spawnmethods from above 93 97 void SOBQBlock::spawnMushroom() { 94 98 SOBCenterpoint* center_ = ((SOB*)getGametype())->center_; … … 101 105 { 102 106 mush->addTemplate("mushroom"); 103 107 mush->setPosition(spawnpos); 108 109 } 110 } 104 111 112 void SOBQBlock::spawnCoin() { 113 SOBCenterpoint* center_ = ((SOB*)getGametype())->center_; 105 114 106 //newBoots->addTemplate(center_->getBootsTemplate()); 115 SOBCoin* mush = new SOBCoin(center_->getContext()); 116 Vector3 spawnpos = this->getWorldPosition(); 117 spawnpos.z += 0; 118 119 if (mush != nullptr && center_ != nullptr) 120 { 121 mush->addTemplate("coin"); 107 122 mush->setPosition(spawnpos); 108 //newBoots->setProperties(leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity); 109 //newBoots->setFigure(figure_); 110 //center_->attach(newBoots); 123 111 124 } 112 125 }
Note: See TracChangeset
for help on using the changeset viewer.