Changeset 12017 for code/branches/PresentationFS18/src
- Timestamp:
- May 30, 2018, 2:41:42 PM (6 years ago)
- Location:
- code/branches/PresentationFS18
- Files:
-
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/PresentationFS18
- Property svn:mergeinfo changed
/code/branches/SuperOrxoBros_FS18 (added) merged: 11820,11987-11988
- Property svn:mergeinfo changed
-
code/branches/PresentationFS18/src/modules/superorxobros/CMakeLists.txt
r11783 r12017 3 3 SOBCenterpoint.cc 4 4 SOB.cc 5 SOBTube.cc 5 6 SOBFigure.cc 6 7 SOBItem.cc … … 14 15 SOBCoin.cc 15 16 SOBGumbaBoss.cc 17 16 18 17 19 ) -
code/branches/PresentationFS18/src/modules/superorxobros/SOB.cc
r11783 r12017 149 149 //If player has reached end of level 150 150 if (this->figure_ != nullptr && figure_->lvlEnded_) { 151 std::stringstream a; 151 std::stringstream a;setLvl(2); 152 152 if(!newHighscore){ 153 153 a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart"; -
code/branches/PresentationFS18/src/modules/superorxobros/SOBFigure.cc
r11783 r12017 43 43 #include <OgreMath.h> 44 44 45 #include "SOBTube.h" 45 46 #include "SOBMushroom.h" 46 47 #include "SOBGumba.h" … … 50 51 #include "SOBFlagstone.h" 51 52 #include "SOBCastlestone.h" 52 #include "SOBFireball.h"53 53 #include "Highscore.h" 54 54 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> … … 72 72 firePressed_ = false; 73 73 collDisZ_ = 0; 74 74 tube = NULL; 75 76 //Variables for Action in Tube 77 tcol_ = false; 78 tubing = false; 79 kkk = 0; 80 75 81 //Times and turning 76 82 timeSinceLastFire_ = 0.0; … … 89 95 reachedLvlEndState_ = 0; 90 96 97 positiontube_=10000; 91 98 // Properties concerning PowerUps and items 99 92 100 PowerUpCounter_ = 0; 93 101 maxPowerUp_ = 2; … … 112 120 113 121 //Orxocast returns object with casted type if otherObject has that class, and if not a nullptr 122 //SOBTube* test; 123 114 124 SOBMushroom* mush = orxonox_cast<SOBMushroom*> (otherObject); 125 tube = orxonox_cast<SOBTube*> (otherObject); 115 126 SOBGumba* gumba = orxonox_cast<SOBGumba*> (otherObject); 116 127 SOBGumbaBoss* gumbaBoss = orxonox_cast<SOBGumbaBoss*> (otherObject); … … 121 132 122 133 134 123 135 //Check if otherObject is a powerup-mushroom 124 136 if (mush != nullptr && !(mush->hasCollided_)) { … … 133 145 134 146 135 } 136 137 138 139 //Check if otherObject is a Gumba (that walking enemies) 140 141 else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {147 }else if(tube != nullptr && !(tube->hasCollided_)){ //Check if other Object is a tube and set position wher tube is in positiontube_ 148 tube->hasCollided_=true;positiontube_=getPosition().x;tcol_=true; //tcol_ used for movedown function in SOBfigure.cc 149 150 151 152 }else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) { 153 //Check if otherObject is a Gumba (that walking enemies) 142 154 143 155 //If player jumps on its head, kill the Gumba, else, kill the player … … 209 221 return 1; 210 222 } 211 223 /*bool SOBFigure::tubeAction(){ 224 return true; 225 }*/ 212 226 //Function to spawn the Fireball 213 227 void SOBFigure::spawnFireball() { … … 240 254 { 241 255 SUPER(SOBFigure, tick, dt); 242 256 243 257 244 258 bool inputAllowed = true; 245 //SOB* SOBGame = orxonox_cast<SOB*>(getGametype());259 246 260 247 261 //the particle spawner that generates the fire from the backpack when pressed … … 291 305 velocity.y = 0; 292 306 //If player falls in a hole 293 if (position.z < -1 00) {307 if (position.z < -180) { 294 308 dead_ = true; 295 309 SOBGame->setDone(true); … … 355 369 356 370 //If moveUp pressed, fire a fireball 357 if(moveUpPressed_ && (PowerUpCounter_ >= FireballPower) && fireallowed_)371 if(moveUpPressed_ && inputAllowed) //if pressed up jump through tube if you are underground 358 372 { 373 Vector3 position1 = getPosition(); 374 375 376 377 378 if(position1.z>=-100 && position1.z<=-40){ 379 position1.z=40; 380 if(460<=position1.x && position1.x<480){setPosition(position1);} //little hack works without this but first tube must be touched //position where second tube is 381 if(positiontube_-10<=position1.x && position1.x<positiontube_+10){ //function for jumping through any SOBtube`s 382 setPosition(position1);}} 383 384 385 if((PowerUpCounter_ >= FireballPower) && fireallowed_){ 359 386 spawnFireball(); 387 360 388 fireallowed_ = false; 361 firecooldown_ = 0; 389 firecooldown_ = 0;} 390 } 391 392 if(moveDownPressed_ && inputAllowed ){ //if movedownpressed change collisiontype of tube and slip through tube 393 394 395 Vector3 position1 = getPosition(); 396 397 398 399 400 if(tube != nullptr && !(tube->movedown)){ //Check if other Object is a tube 401 402 if(positiontube_-10<position1.x && position1.x<positiontube_+10){ 403 tube->movedown=true;} 404 } 405 362 406 } 363 407 … … 419 463 moveLeftPressed_ = false; 420 464 moveRightPressed_ = false; 465 421 466 422 467 isColliding_ = false; -
code/branches/PresentationFS18/src/modules/superorxobros/SOBFigure.h
r11783 r12017 32 32 #include "superorxobros/SOBPrereqs.h" 33 33 #include "worldentities/ControllableEntity.h" 34 #include "SOBTube.h" 34 35 35 36 … … 58 59 //Soooo many declarations 59 60 bool fireallowed_; 60 61 bool moveUpPressed_; 61 SOBTube* tube; //class SOBTube* used because tube needs to be global using in collides against function and tick function in SOBfigure.cc 62 bool moveUpPressed_; 63 int kkk; 64 65 bool tcol_; //used for getting through tube 66 bool tubing; //used for getting through tube 62 67 bool moveDownPressed_; 63 68 bool moveLeftPressed_; … … 68 73 float lastSpeed_z; 69 74 float firecooldown_; 75 float positiontube_; 70 76 bool isColliding_; 71 77 WorldEntity* particlespawner_; -
code/branches/PresentationFS18/src/modules/superorxobros/SOBGumba.cc
r11783 r12017 106 106 { 107 107 SUPER(SOBGumba, tick, dt); 108 108 109 109 if (!changeAllowed_) { 110 110 changedOn_+= dt; -
code/branches/PresentationFS18/src/modules/superorxobros/SOBItem.h
r11783 r12017 49 49 virtual void setFigure(SOBFigure* newFigure); 50 50 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 51 52 51 53 52 bool attachedToFigure_; -
code/branches/PresentationFS18/src/modules/superorxobros/SOBPrereqs.h
r11783 r12017 80 80 class SOBCastlestone; 81 81 class SOBCoin; 82 class SOBTube; 82 83 83 84 }
Note: See TracChangeset
for help on using the changeset viewer.