- Timestamp:
- Nov 20, 2017, 3:21:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
r11573 r11575 42 42 #include "SOBMushroom.h" 43 43 #include "SOBGumba.h" 44 #include "SOBFireball.h" 44 45 #include "SOB.h" 45 46 #include "SOBFlagstone.h" … … 103 104 104 105 //Orxocast returns object with casted type if otherObject has that class, and if not a nullptr 105 SOBMushroom* mush = orxonox_cast<SOBMushroom*>(otherObject); 106 SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject); 107 SOBFlagstone* flagstone = orxonox_cast<SOBFlagstone*>(otherObject); 108 SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*>(otherObject); 106 SOBMushroom* mush = orxonox_cast<SOBMushroom*> (otherObject); 107 SOBGumba* gumba = orxonox_cast<SOBGumba*> (otherObject); 108 SOBFlagstone* flagstone = orxonox_cast<SOBFlagstone*> (otherObject); 109 SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*> (otherObject); 110 SOBFireball* fireball = orxonox_cast<SOBFireball*> (otherObject); 109 111 110 112 //Check if otherObject is a powerup … … 122 124 } 123 125 126 124 127 //Check if otherObject is a Gumba (that walking enemies) 125 128 … … 130 133 // If player hasn't a power up, he dies. Else he shrinks and the gumba dies. 131 134 if(!gotPowerUp_){ 132 Vector3 vel = getVelocity(); 133 vel.y = -80; 134 vel.z = 200; 135 setVelocity(vel); 136 predead_=true; 137 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 138 SOBGame->setDone(true); 135 this->die(); 139 136 } else{ 140 137 gotPowerUp_ = false; … … 158 155 } 159 156 157 else if (fireball != nullptr && !(fireball->hasCollided_)){ 158 this-> die(); 159 } 160 160 161 //Purpose is that if player hits the flag, he should walk into the castle at the end of the level. For that we use SOBCastlestone 161 162 if (reachedLvlEndState_ == 0 && flagstone != nullptr && !(flagstone->hasCollided_)) { … … 440 441 } 441 442 442 } 443 void SOBFigure::die(){ 444 Vector3 vel = getVelocity(); 445 vel.y = -80; 446 vel.z = 200; 447 setVelocity(vel); 448 predead_=true; 449 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 450 SOBGame->setDone(true); 451 } 452 453 }
Note: See TracChangeset
for help on using the changeset viewer.