- Timestamp:
- Dec 4, 2017, 3:36:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.cc
r11628 r11629 54 54 RegisterObject(SOBGumbaBoss); 55 55 56 gumbaMaxTime_ = 5;56 gumbaMaxTime_ = 4; 57 57 gumbaTime_ = 0; 58 maxGumbas = 10; //Max Gumbas spawnable by a Boss 58 59 59 60 } 60 61 62 61 63 62 … … 93 92 94 93 if(gumbaTime_ > gumbaMaxTime_){ 95 spawn Fireball();94 spawnGumba(); 96 95 gumbaTime_ = 0; 97 96 } … … 109 108 110 109 } 111 void SOBGumbaBoss::spawn Fireball() {110 void SOBGumbaBoss::spawnGumba() { 112 111 SOBCenterpoint* center_ = ((SOB*)getGametype())->center_; 113 112 114 SOB Fireball* ball = new SOBFireball(center_->getContext());113 SOBGumba* gumba = new SOBGumba(center_->getContext()); 115 114 Vector3 spawnpos = this->getWorldPosition(); 116 115 spawnpos.z += 0; 117 116 118 if ( ball!= nullptr && center_ != nullptr)117 if (gumba != nullptr && center_ != nullptr) 119 118 { 120 ball->addTemplate("fireball");119 gumba->addTemplate("gumbaShootable"); 121 120 bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6)); 122 ball->setDirection(direction);121 gumba->setDirection(direction); 123 122 if(direction) 124 123 { 125 spawnpos.x+= 10;124 spawnpos.x+=20; 126 125 } 127 126 else 128 127 { 129 spawnpos.x-= 10;128 spawnpos.x-=20; 130 129 } 131 ball->setPosition(spawnpos); 130 spawnpos.z+=15; 131 gumba->setPosition(spawnpos); 132 132 133 133 } 134 134 135 Vector3 velocity = ball->getVelocity();135 Vector3 velocity = gumba->getVelocity(); 136 136 velocity.z -= 100; 137 ball->setVelocity(velocity);137 gumba->setVelocity(velocity); 138 138 } 139 139 }
Note: See TracChangeset
for help on using the changeset viewer.