Changeset 11400 for code/branches/SuperOrxoBros_FS17
- Timestamp:
- Apr 13, 2017, 3:30:24 PM (8 years ago)
- Location:
- code/branches/SuperOrxoBros_FS17
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
r11398 r11400 29 29 <attached> 30 30 <Model mesh="Orxo.mesh" scale=2.5 pitch=0 roll=90 yaw=90/> 31 <ParticleSpawner source="Orxonox/fire4" startdelay=0 position="-4,0,0" visible="false"/> 31 32 </attached> 32 33 … … 110 111 111 112 //Luft1 112 <Model mesh="Cube1.1.mesh" position="120,0,20" scale=10/><!-- ? Block --> <!-- 1 --> 113 114 115 116 <!-- BLOCK 1 in der LUFT - alle analog wie diesen :) --> 117 <!-- Sobald ein QBlock von unten gehittet wird, wechselt die Visibility von allen attached Models. Hier wuerde also Cube1.1 invisible und Cube2.12 visible. Die Collisionshape wird ja sowieso beibehalten. --> 118 <SOBQBlock collisionType="static"> 119 <attached> 120 <Model mesh="Cube1.1.mesh" position="120,0,20" scale=10/> 121 <Model mesh="Cube2.12.mesh" position="120,0,20" scale=10 visible="false"/> 122 </attached> 123 <collisionShapes> 124 <BoxCollisionShape position="120,0,20" halfExtents="5,5,5" /><!-- 1 --> 125 </collisionShapes> 126 </SOBQBlock> 127 128 129 130 131 132 133 134 135 <!-- <Model mesh="Cube1.1.mesh" position="120,0,20" scale=10/><!-- ? Block --> <!-- 1 --> 113 136 <Model mesh="Cube1.1.mesh" position="160,0,20" scale=10 /> <!-- 2 --> 114 137 <Model mesh="Cube1.1.mesh" position="170,0,20" scale=10 /><!-- Item Block --> <!-- 3 --> … … 118 141 <Model mesh="Cube1.1.mesh" position="200,0,20" scale=10/> <!-- 7 --> 119 142 120 121 122 123 124 125 126 127 128 129 130 131 132 143 <StaticEntity collisionType="static"> 144 <collisionShapes> 145 <!--<BoxCollisionShape position="120,0,20" halfExtents="5,5,5" /><!-- 1 --> 146 <BoxCollisionShape position="160,0,20" halfExtents="5,5,5" /><!-- 2 --> 147 <BoxCollisionShape position="170,0,20" halfExtents="5,5,5" /><!-- 3 --> 148 <BoxCollisionShape position="180,0,20" halfExtents="5,5,5" /><!-- 4 --> 149 <BoxCollisionShape position="180,0,60" halfExtents="5,5,5" /><!-- 5 --> 150 <BoxCollisionShape position="190,0,20" halfExtents="5,5,5" /><!-- 6 --> 151 <BoxCollisionShape position="200,0,20" halfExtents="5,5,5" /><!-- 7 --> 152 153 154 </collisionShapes> 155 </StaticEntity> 133 156 134 157 … … 157 180 <Model mesh="Cube1.1.mesh" position="600,0,60" scale=10/> 158 181 159 160 161 162 163 164 165 166 167 168 169 170 182 <StaticEntity collisionType="static"> 183 <collisionShapes> 184 <BoxCollisionShape position="500,0,20" halfExtents="5,5,5" /> 185 <BoxCollisionShape position="510,0,20" halfExtents="5,5,5" /> 186 <BoxCollisionShape position="520,0,20" halfExtents="5,5,5" /> 187 <BoxCollisionShape position="570,0,60" halfExtents="40,5,5" /> 188 189 190 191 192 </collisionShapes> 193 </StaticEntity> 171 194 172 195 … … 200 223 201 224 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 225 <StaticEntity collisionType="static"> 226 <collisionShapes> 227 <BoxCollisionShape position="645,0,60" halfExtents="15,5,5" /> <!-- 1 --> 228 <BoxCollisionShape position="670,0,20" halfExtents="5,5,5" /> <!-- 2 --> 229 <BoxCollisionShape position="670,0,60" halfExtents="5,5,5" /> <!-- 3 --> 230 231 <BoxCollisionShape position="720,0,20" halfExtents="5,5,5" /> <!-- 4 --> 232 <BoxCollisionShape position="730,0,20" halfExtents="5,5,5" /> <!-- 5 --> 233 <BoxCollisionShape position="780,0,20" halfExtents="5,5,5" /> <!-- 6 --> 234 <BoxCollisionShape position="800,0,20" halfExtents="5,5,5" /> <!-- 7 --> 235 <BoxCollisionShape position="800,0,60" halfExtents="5,5,5" /> <!-- 8 --> 236 <BoxCollisionShape position="820,0,20" halfExtents="5,5,5" /> <!-- 9 --> 237 238 <BoxCollisionShape position="890,0,20" halfExtents="5,5,5" /> <!-- 10 --> 239 <BoxCollisionShape position="930,0,60" halfExtents="15,5,5" /> <!-- 11 --> 240 <BoxCollisionShape position="990,0,60" halfExtents="5,5,5" /> <!-- 12 --> 241 <BoxCollisionShape position="1020,0,60" halfExtents="5,5,5" /> <!-- 13 --> 242 <BoxCollisionShape position="1005,0,20" halfExtents="10,5,5" /> <!-- 14 --> 243 <BoxCollisionShape position="1000,0,60" halfExtents="5,5,5" /> <!-- 15 --> 244 <BoxCollisionShape position="1010,0,60" halfExtents="5,5,5" /> <!-- 16 --> 245 246 247 248 249 </collisionShapes> 250 </StaticEntity> 228 251 229 252 … … 254 277 255 278 256 257 258 259 260 261 262 263 264 265 266 267 279 <StaticEntity collisionType="static"> 280 <collisionShapes> 281 <BoxCollisionShape position="1400,0,20" halfExtents="5,5,5" /> 282 <BoxCollisionShape position="1410,0,20" halfExtents="5,5,5" /> 283 <BoxCollisionShape position="1420,0,20" halfExtents="5,5,5" /> 284 <BoxCollisionShape position="1430,0,20" halfExtents="5,5,5" /> 285 286 287 288 289 </collisionShapes> 290 </StaticEntity> 268 291 269 292 -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/CMakeLists.txt
r11392 r11400 5 5 SOBFigure.cc 6 6 SOBItem.cc 7 7 SOBQBlock.cc 8 8 9 9 ) -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
r11392 r11400 38 38 #include "graphics/Model.h" 39 39 #include "graphics/Camera.h" 40 #include "graphics/ParticleSpawner.h" 41 40 42 41 43 namespace orxonox … … 56 58 timeSinceLastFire_ = 0.0; 57 59 lastSpeed_z = 0.0; 58 59 gravityAcceleration_ = 250.0; 60 isColliding_ = true; 61 particlespawner_ = NULL; 62 63 gravityAcceleration_ = 350.0; 60 64 pitch_ = 0.0; 61 65 62 66 dead_ = false; 63 67 setAngularFactor(0.0); 64 } 68 this->enableCollisionCallback(); 69 } 70 71 72 73 bool SOBFigure::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { 74 75 isColliding_ = true; 76 77 78 return true; 79 } 80 81 65 82 66 83 void SOBFigure::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 70 87 } 71 88 89 90 72 91 void SOBFigure::tick(float dt) 73 92 { 74 93 SUPER(SOBFigure, tick, dt); 94 95 if (particlespawner_ == NULL) { 96 for (WorldEntity* object : this->getAttachedObjects()) 97 { 98 if (object->isA(Class(ParticleSpawner))) 99 particlespawner_ = object; 100 101 } 102 103 } 104 105 106 107 108 109 if (firePressed_ == false) { 110 gravityAcceleration_ = 350.0; 111 112 } 75 113 76 114 if (hasLocalController()) … … 96 134 97 135 136 //Handle the rocket fire from the jetpack 137 if (velocity.z > 40) 138 particlespawner_->setVisible(true); 139 else 140 particlespawner_->setVisible(false); 141 98 142 //If player hits space and does not move in z-dir 99 if (firePressed_ && std::abs(velocity.z) < 0.07 && std::abs(lastSpeed_z) < 0.07) { 100 velocity.z = 150; 143 if (firePressed_ && isColliding_ && std::abs(velocity.z) < 0.1 && std::abs(lastSpeed_z) < 0.1) { 144 gravityAcceleration_ = 100.0; 145 velocity.z = 110; //150 101 146 } 102 147 103 148 // rotate(1,getOrientation()* WorldEntity::FRONT) 104 149 150 105 151 //Left-right movement with acceleration 152 float rot = getOrientation().getRoll().valueDegrees(); 106 153 if (moveRightPressed_) { 154 if (rot < 0.0) 155 setOrientation(Vector3::UNIT_Z, getOrientation().getRoll() + dt*Radian(6)); 156 107 157 if (std::abs(velocity.x) < maxvelocity_x) { 108 158 velocity.x += speedAddedPerTick; 159 160 161 162 163 109 164 // if (pitch_ > 0.0) { 110 165 // pitch -= turn_fac*dt); … … 112 167 } 113 168 } else if (moveLeftPressed_) { 169 if (rot >= 0.0) 170 setOrientation(Vector3::UNIT_Z, getOrientation().getRoll() + dt*Radian(6)); 171 114 172 if (std::abs(velocity.x) < maxvelocity_x) { 115 173 velocity.x -= speedAddedPerTick; … … 152 210 moveRightPressed_ = false; 153 211 moveDownPressed_ = false; 154 firePressed_ = false;212 isColliding_ = false; 155 213 156 214 } … … 195 253 void SOBFigure::boost(bool boost) 196 254 { 197 firePressed_ = true;198 } 199 } 255 firePressed_ = boost; 256 } 257 } -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
r11392 r11400 33 33 #include "worldentities/ControllableEntity.h" 34 34 35 35 36 namespace orxonox 36 37 { … … 47 48 48 49 virtual void boost(bool boost) override; 49 50 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 51 50 52 51 53 //virtual void CollisionWithEnemy(SOBEnemy* enemy); … … 69 71 SOBCenterpoint* sobcenterpoint; 70 72 float pitch_; 73 bool isColliding_; 74 WorldEntity* particlespawner_; 71 75 72 76 -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.cc
r11392 r11400 67 67 bool SOBItem::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { 68 68 69 orxout() << "Watshc bum baem" << endl;69 //orxout() << "Watshc bum baem" << endl; 70 70 return true; 71 71 } -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.h
r11392 r11400 50 50 virtual void touchFigure(); 51 51 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 52 52 53 53 54 54 bool attachedToFigure_; -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBPrereqs.h
r11392 r11400 78 78 class SOBFigure; 79 79 class SOBItem; 80 class SOBQBlock; 80 81 /* 81 82 class PongScore;*/
Note: See TracChangeset
for help on using the changeset viewer.