Changeset 11629 for code/branches/SOBv2_HS17/src
- Timestamp:
- Dec 4, 2017, 3:36:20 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17/src/modules/superorxobros
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.cc
r11567 r11629 60 60 changeAllowed_ = true; 61 61 changedOn_ = 0.0; 62 creator_ = nullptr; 62 63 63 64 } … … 91 92 } 92 93 93 94 void SOBGumba::setDirection(const bool direction) 95 { 96 if(direction) 97 { 98 goesRight_=true; 99 } 100 else 101 { 102 goesRight_=false; 103 } 104 } 94 105 95 106 void SOBGumba::tick(float dt) -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumba.h
r11416 r11629 51 51 virtual void tick(float dt) override; 52 52 53 void setDirection(const bool direction); 53 54 54 55 bool attachedToFigure_; … … 68 69 bool changeAllowed_; 69 70 float changedOn_; 71 SOBGumbaBoss* creator_; 70 72 71 73 }; -
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 } -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBGumbaBoss.h
r11623 r11629 50 50 virtual void tick(float dt) override; 51 51 52 void spawn Fireball();52 void spawnGumba(); 53 53 54 54 … … 56 56 float gumbaTime_; 57 57 float gumbaMaxTime_; 58 int maxGumbas; 59 58 60 59 61 };
Note: See TracChangeset
for help on using the changeset viewer.