Changeset 11629
- Timestamp:
- Dec 4, 2017, 3:36:20 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/data/levels/SOB.oxw
r11623 r11629 79 79 </Template> 80 80 81 <Template name=gumbaShootable> 82 <SOBGumbaBoss collisionType="dynamic" speed=40> 83 <attached> 84 <Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/> 85 </attached> 86 <collisionShapes> 87 <BoxCollisionShape position="0,0,0" halfExtents="5,5,3" /> 88 </collisionShapes> 89 </SOBGumbaBoss> 90 </Template> 81 91 82 92 … … 117 127 118 128 119 <SOBGumba BosscollisionType="dynamic" speed=40 position = "240,0,0">129 <SOBGumba collisionType="dynamic" speed=40 position = "240,0,0"> 120 130 <attached> 121 131 <Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/> … … 125 135 <BoxCollisionShape position="0,0,0" halfExtents="5,5,3" /> 126 136 </collisionShapes> 137 </SOBGumba> 138 139 <SOBGumba collisionType="dynamic" speed=30 position = "420,0,0"> 140 <attached> 141 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 142 143 </attached> 144 <collisionShapes> 145 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 146 </collisionShapes> 147 </SOBGumba> 148 <SOBGumba collisionType="dynamic" speed=30 position = "500,0,0"> 149 <attached> 150 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 151 152 </attached> 153 <collisionShapes> 154 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 155 </collisionShapes> 156 </SOBGumba> 157 158 <SOBGumba collisionType="dynamic" speed=30 position = "510,0,0"> 159 <attached> 160 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 161 162 </attached> 163 <collisionShapes> 164 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 165 </collisionShapes> 166 </SOBGumba> 167 <SOBGumba collisionType="dynamic" speed=30 position = "930,0,0"> 168 <attached> 169 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 170 171 </attached> 172 <collisionShapes> 173 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 174 </collisionShapes> 175 </SOBGumba> 176 177 <SOBGumba collisionType="dynamic" speed=20 position = "940,0,0"> 178 <attached> 179 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 180 </attached> 181 <collisionShapes> 182 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 183 </collisionShapes> 184 </SOBGumba> 185 186 <SOBGumba collisionType="dynamic" speed=30 position = "1180,0,0"> 187 <attached> 188 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 189 190 </attached> 191 <collisionShapes> 192 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 193 </collisionShapes> 194 </SOBGumba> 195 196 <SOBGumba collisionType="dynamic" speed=20 position = "1190,0,0"> 197 <attached> 198 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 199 200 </attached> 201 <collisionShapes> 202 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 203 </collisionShapes> 204 </SOBGumba> 205 206 <SOBGumba collisionType="dynamic" speed=30 position = "1320,0,0"> 207 <attached> 208 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 209 210 </attached> 211 <collisionShapes> 212 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 213 </collisionShapes> 214 </SOBGumba> 215 216 <SOBGumba collisionType="dynamic" speed=20 position = "1330,0,0"> 217 <attached> 218 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 219 220 </attached> 221 <collisionShapes> 222 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 223 </collisionShapes> 224 </SOBGumba> 225 226 <!--GumbaBoss--> 227 <SOBGumbaBoss collisionType="dynamic" speed=20 position = "1750,0,0"> 228 <attached> 229 <Model mesh="Goomba.mesh" position="0,0,21" scale=6 pitch=90/> 230 231 </attached> 232 <collisionShapes> 233 <BoxCollisionShape position="0,0,20" halfExtents="10,10,6" /> 234 </collisionShapes> 127 235 </SOBGumbaBoss> 128 129 <SOBGumba collisionType="dynamic" speed=30 position = "420,0,0"> 130 <attached> 131 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 132 133 </attached> 134 <collisionShapes> 135 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 136 </collisionShapes> 137 </SOBGumba> 138 <SOBGumba collisionType="dynamic" speed=30 position = "500,0,0"> 139 <attached> 140 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 141 142 </attached> 143 <collisionShapes> 144 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 145 </collisionShapes> 146 </SOBGumba> 147 148 <SOBGumba collisionType="dynamic" speed=30 position = "510,0,0"> 149 <attached> 150 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 151 152 </attached> 153 <collisionShapes> 154 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 155 </collisionShapes> 156 </SOBGumba> 157 <SOBGumba collisionType="dynamic" speed=30 position = "930,0,0"> 158 <attached> 159 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 160 161 </attached> 162 <collisionShapes> 163 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 164 </collisionShapes> 165 </SOBGumba> 166 167 <SOBGumba collisionType="dynamic" speed=20 position = "940,0,0"> 168 <attached> 169 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 170 </attached> 171 <collisionShapes> 172 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 173 </collisionShapes> 174 </SOBGumba> 175 176 <SOBGumba collisionType="dynamic" speed=30 position = "1180,0,0"> 177 <attached> 178 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 179 180 </attached> 181 <collisionShapes> 182 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 183 </collisionShapes> 184 </SOBGumba> 185 186 <SOBGumba collisionType="dynamic" speed=20 position = "1190,0,0"> 187 <attached> 188 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 189 190 </attached> 191 <collisionShapes> 192 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 193 </collisionShapes> 194 </SOBGumba> 195 196 <SOBGumba collisionType="dynamic" speed=30 position = "1320,0,0"> 197 <attached> 198 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 199 200 </attached> 201 <collisionShapes> 202 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 203 </collisionShapes> 204 </SOBGumba> 205 206 <SOBGumba collisionType="dynamic" speed=20 position = "1330,0,0"> 207 <attached> 208 <Model mesh="Goomba.mesh" position="0,0,21" scale=3 pitch=90/> 209 210 </attached> 211 <collisionShapes> 212 <BoxCollisionShape position="0,0,20" halfExtents="5,5,3" /> 213 </collisionShapes> 214 </SOBGumba> 215 216 <!--GumbaBoss--> 217 <SOBGumba collisionType="dynamic" speed=30 position = "1750,0,0"> 218 <attached> 219 <Model mesh="Goomba.mesh" position="0,0,21" scale=6 pitch=90/> 220 221 </attached> 222 <collisionShapes> 223 <BoxCollisionShape position="0,0,80" halfExtents="10,10,10" /> 224 </collisionShapes> 225 </SOBGumba> 226 236 x 227 237 228 238 <!--CollisionShape for Gumba--> -
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.