Changeset 11650 for code/branches/SOBv2_HS17/src/modules/superorxobros
- Timestamp:
- Dec 11, 2017, 2:14:15 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17/src/modules/superorxobros
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
r11628 r11650 115 115 SOBMushroom* mush = orxonox_cast<SOBMushroom*> (otherObject); 116 116 SOBGumba* gumba = orxonox_cast<SOBGumba*> (otherObject); 117 SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*> 117 SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*> (otherObject); 118 118 SOBFlagstone* flagstone = orxonox_cast<SOBFlagstone*> (otherObject); 119 119 SOBCastlestone* castlestone = orxonox_cast<SOBCastlestone*> (otherObject); -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFlagstone.h
r11416 r11650 29 29 /** 30 30 @file SOBFlagstone.h 31 @brief Declaration of the SOBFlagstone class. This class is used for the flag - for everz 10x10x10 stone we added a flagstone with different points. The higher you touch the flag, the more points you get. 31 @brief Declaration of the SOBFlagstone class. 32 This class is used for the flag - for every 10x10x10 stone we added a flagstone with different points. The higher you touch the flag, the more points you get. 32 33 @ingroup SOB 33 34 */ -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.cc
r11629 r11650 124 124 125 125 Vector3 velocity = getVelocity(); 126 if(velocity.z > -1 && velocity.z < 1) 127 { 128 velocity.x = dir*speed_; 129 } 130 126 131 velocity.z -= gravityAcceleration_*dt; 127 velocity.x = dir*speed_;128 132 setVelocity(velocity); 129 133 -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc
r11647 r11650 31 31 @file SOBGumbaBoss.cc 32 32 @brief A Boss Gumba, which shoots small Gumbas 33 * /33 **/ 34 34 35 35 #include "SOB.h" … … 54 54 RegisterObject(SOBGumbaBoss); 55 55 56 gumbaMaxTime_ = 1; 57 gumbaTime_ = 0; 58 maxGumbas = 2; //Max Gumbas spawnable by a Boss 56 gumbaMaxTime_ = 1; 57 gumbaTime_ = 0; 58 maxGumbas_ = 10; //Max Gumbas spawnable by a Boss 59 jumpTime_ = 0; 60 jumpTimeMax_ = 5; 59 61 60 62 } … … 63 65 bool SOBGumbaBoss::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { 64 66 67 SOBGumba* gumba = orxonox_cast<SOBGumba*>(otherObject); 68 SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*>(otherObject); 69 70 if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) { 71 gumba->destroyLater(); 72 gumba->hasCollided_ = true; 73 } 74 75 65 76 //Every object with mass -1 does not change the direction of the GumbaBoss. For example the ground floor! The other objects switch the direction of the GumbaBoss. 66 if (changeAllowed_ && otherObject->getMass() != -1) {77 else if (changeAllowed_ && otherObject->getMass() != -1) { 67 78 goesRight_ = !goesRight_; 68 79 changeAllowed_ = false; … … 78 89 { 79 90 SUPER(SOBGumbaBoss, tick, dt); 91 gumbaTime_ += dt; 92 jumpTime_ += dt; 80 93 81 94 if (!changeAllowed_) { … … 89 102 } 90 103 91 gumbaTime_ += dt;92 104 93 105 if(gumbaTime_ > gumbaMaxTime_){ //Spawn Gumba … … 103 115 104 116 105 if(gumbaCounter<maxGumbas ){ //only maxGumbas are allowed at one time per Gumbaboss117 if(gumbaCounter<maxGumbas_){ //only maxGumbas are allowed at one time per Gumbaboss 106 118 spawnGumba(); 107 119 gumbaTime_ = 0; … … 114 126 115 127 Vector3 velocity = getVelocity(); 116 velocity.z -= gravityAcceleration_*dt; 128 if(jumpTime_ > jumpTimeMax_){ 129 velocity.z = speed_*15; 130 jumpTime_ = 0; 131 } 132 else{ 133 velocity.z -= gravityAcceleration_*dt; 134 } 135 117 136 velocity.x = dir*speed_; 118 137 setVelocity(velocity); … … 132 151 { 133 152 gumba->addTemplate("gumbaShootable"); 134 bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6)); 135 gumba->setDirection(direction); 136 if(direction) 153 gumba->setDirection(goesRight_); 154 if(goesRight_) 137 155 { 138 156 spawnpos.x+=20; … … 148 166 149 167 Vector3 velocity = gumba->getVelocity(); 150 velocity.z -= 100; 168 velocity.x += (2*goesRight_ -1) * 100; 169 velocity.z += 200; 151 170 gumba->setVelocity(velocity); 152 171 } -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.h
r11629 r11650 56 56 float gumbaTime_; 57 57 float gumbaMaxTime_; 58 int maxGumbas; 58 float jumpTimeMax_; 59 float jumpTime_; 60 int maxGumbas_; 61 59 62 60 63
Note: See TracChangeset
for help on using the changeset viewer.