Changeset 11601 for code/branches/SOBv2_HS17
- Timestamp:
- Nov 27, 2017, 3:32:34 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/SOB.cc
r11418 r11601 44 44 #include "SOBFigure.h" 45 45 #include "graphics/Camera.h" 46 #include "Highscore.h" 46 47 47 48 … … 49 50 namespace orxonox 50 51 { 51 52 bool newHighscore=0; 52 53 RegisterUnloadableClass(SOB); 53 54 … … 124 125 GSLevel::startMainMenu(); 125 126 Deathmatch::end(); 126 127 } 127 128 128 129 void SOB::restart() { … … 167 168 if (this->figure_ != nullptr && figure_->lvlEnded_) { 168 169 std::stringstream a; 169 a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart"; 170 if(newHighscore){ 171 a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart"; 172 } 173 else{ 174 a << "Congrats, new Highscore! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart"; 175 } 170 176 info_ =a.str(); 171 177 -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOB.h
r11418 r11601 103 103 104 104 WeakPtr<SOBCenterpoint> center_; 105 bool newHighscore; 105 106 106 107 protected: -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
r11599 r11601 50 50 #include "SOBCastlestone.h" 51 51 #include "SOBFireball.h" 52 #include "Highscore.h" 52 53 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> 53 54 … … 208 209 bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6)); 209 210 ball->setDirection(direction); 210 orxout() << "Rotation: " << this->getWorldOrientation().getRoll() << " direction: "<< direction <<endl;211 211 if(direction) 212 212 { … … 229 229 230 230 bool inputAllowed = true; 231 //SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 231 232 232 233 //the particle spawner that generates the fire from the backpack when pressed … … 365 366 velocity.x = 0; 366 367 velocity.y = 20; 368 setOrientation(Vector3::UNIT_Z, Degree(90)); 367 369 } 368 370 if (reachedLvlEndState_ == 4) { 371 //Highscore 372 if (Highscore::exists()){ 373 int score = SOBGame->getPoints(); 374 if(score > Highscore::getInstance().getHighestScoreOfGame("Super Orxo Bros.")) 375 Highscore::getInstance().storeHighscore("Super Orxo Bros.",score); 376 SOBGame->newHighscore=1; 377 378 } 369 379 lvlEnded_ = true; 370 380 dead_ = true; -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
r11599 r11601 140 140 hitCounter_++; 141 141 142 collDisZ_=0; 143 collDisX_=0; 144 142 145 return true; 143 146 } … … 170 173 changedOn_+= dt; 171 174 // After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions! 172 if (changedOn_> 0. 100) {175 if (changedOn_> 0.2) { 173 176 changeAllowed_ = true; 174 177 changedOn_ = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.