Changeset 11632
- Timestamp:
- Dec 4, 2017, 4:00:44 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17/src/modules/superorxobros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.h
r11629 r11632 61 61 62 62 bool hasCollided_; 63 SOBGumbaBoss* creator_; 63 64 protected: 64 65 float gravityAcceleration_; … … 69 70 bool changeAllowed_; 70 71 float changedOn_; 71 SOBGumbaBoss* creator_; 72 72 73 73 74 }; -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc
r11629 r11632 54 54 RegisterObject(SOBGumbaBoss); 55 55 56 gumbaMaxTime_ = 4;56 gumbaMaxTime_ = 1; 57 57 gumbaTime_ = 0; 58 maxGumbas = 10; //Max Gumbas spawnable by a Boss58 maxGumbas = 2; //Max Gumbas spawnable by a Boss 59 59 60 60 } … … 91 91 gumbaTime_ += dt; 92 92 93 if(gumbaTime_ > gumbaMaxTime_){ 94 spawnGumba(); 95 gumbaTime_ = 0; 93 if(gumbaTime_ > gumbaMaxTime_){ //Spawn Gumba 94 int gumbaCounter=0; 95 96 for (SOBGumba* gumbaInstance : ObjectList<SOBGumba>()) 97 { 98 if (gumbaInstance != nullptr && gumbaInstance->creator_==this) 99 { 100 gumbaCounter++; 101 } 102 } 103 104 105 if(gumbaCounter<maxGumbas){ 106 spawnGumba(); 107 gumbaTime_ = 0; 108 } 96 109 } 97 110 … … 114 127 Vector3 spawnpos = this->getWorldPosition(); 115 128 spawnpos.z += 0; 129 gumba->creator_=this; 116 130 117 131 if (gumba != nullptr && center_ != nullptr)
Note: See TracChangeset
for help on using the changeset viewer.