- Timestamp:
- Apr 27, 2017, 3:08:16 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBQBlock.cc
r11400 r11405 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/XMLPort.h" 38 #include "SOB.h" 39 #include "SOBMushroom.h" 37 40 38 41 namespace orxonox … … 62 65 if (!used_ && v_z > 50.0) { 63 66 used_ = true; 64 orxout() << "WDestrozed the block" << v_z << endl;65 67 66 for (WorldEntity* object : this->getAttachedObjects()) 67 { 68 69 70 object->setVisible(!object->isVisible()); 68 for (WorldEntity* object : this->getAttachedObjects()) 69 object->setVisible(!object->isVisible()); 70 71 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 72 if (type_ == "Coin") { 73 SOBGame->addCoin(); 71 74 } 72 73 75 if (type_ == "Mushroom") { 76 spawnMushroom(); 77 } 74 78 75 79 } … … 78 82 79 83 84 void SOBQBlock::XMLPort(Element& xmlelement, XMLPort::Mode mode) 85 { 86 SUPER(SOBQBlock, XMLPort, xmlelement, mode); 87 XMLPortParam(SOBQBlock, "type", setType, getType, xmlelement, mode).defaultValues(false); 88 89 90 } 91 92 93 void SOBQBlock::spawnMushroom() { 94 SOBCenterpoint* center_ = ((SOB*)getGametype())->center_; 95 96 SOBMushroom* mush = new SOBMushroom(center_->getContext()); 97 Vector3 spawnpos = this->getWorldPosition(); 98 spawnpos.z += 0; 99 100 if (mush != nullptr && center_ != nullptr) 101 { 102 mush->addTemplate("mushroom"); 103 104 105 106 //newBoots->addTemplate(center_->getBootsTemplate()); 107 mush->setPosition(spawnpos); 108 //newBoots->setProperties(leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity); 109 //newBoots->setFigure(figure_); 110 //center_->attach(newBoots); 111 } 112 } 113 114 80 115 }
Note: See TracChangeset
for help on using the changeset viewer.