Changeset 11533 for code/branches/FlappyOrx_HS17/src/modules/flappyorx
- Timestamp:
- Nov 6, 2017, 2:12:57 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17/src/modules/flappyorx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
r11529 r11533 63 63 bEndGame = false; 64 64 lives = 1; 65 level = 1;65 level = 0; 66 66 point = 0; 67 67 bShowLevel = false; … … 81 81 this->tubes.pop(); 82 82 levelUp(); 83 point++; 83 84 } 84 85 } … … 87 88 { 88 89 level++; 89 //toggleShowLevel();90 toggleShowLevel(); 90 91 //showLevelTimer.setTimer(3.0f, false, createExecutor(createFunctor(&FlappyOrx::toggleShowLevel, this))); 91 92 } -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
r11529 r11533 96 96 private: 97 97 void toggleShowLevel(){bShowLevel = !bShowLevel;} 98 98 99 99 const static int nAst = 7; 100 100 Circle Asteroids[nAst]; -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.cc
r11521 r11533 42 42 this->FlappyOrxGame = nullptr; 43 43 this->bShowLives_ = false; 44 this->bShowLevel_ = false;44 this->bShowLevel_ = true; 45 45 this->bShowPoints_ = false; 46 46 this->bShowMultiplier_ = false; … … 51 51 SUPER(FlappyOrxHUDinfo, XMLPort, xmlelement, mode); 52 52 53 //XMLPortParam(FlappyOrxHUDinfo, "showlives", setShowLives, getShowLives, xmlelement, mode).defaultValues(false);54 55 // XMLPortParam(FlappyOrxHUDinfo, "showLevel", setShowLevel, getShowLevel, xmlelement, mode).defaultValues(false);56 // XMLPortParam(FlappyOrxHUDinfo, "showMultiplier", setShowMultiplier, getShowMultiplier, xmlelement, mode).defaultValues(false);53 XMLPortParam(FlappyOrxHUDinfo, "showlives", setShowLives, getShowLives, xmlelement, mode).defaultValues(false); 54 XMLPortParam(FlappyOrxHUDinfo, "showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false); 55 56 57 57 } 58 58 … … 63 63 if (this->FlappyOrxGame) 64 64 { 65 // if (this->bShowLives_) 65 // if (this->bShowLives_) //preperation for easy mode 66 66 // { 67 // const std::string& lives = multi_cast<std::string>(this-> FlappyOrxGame->getLives());67 // const std::string& lives = multi_cast<std::string>(this->InvaderGame->getLives()); 68 68 // this->setCaption(lives); 69 // }70 // else if(this->bShowLevel_)71 // {72 // const std::string& Level = multi_cast<std::string>(this->FlappyOrxGame->getLevel());73 // if (this->FlappyOrxGame->lives <= 0)74 // {75 // setPosition(Vector2(0.1, 0.65));76 // this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart fly out of the screen!");77 // setTextSize(0.05);78 // this->FlappyOrxGame->bEndGame = true;79 // }80 // else if (this->FlappyOrxGame->bShowLevel)81 // {82 // setTextSize(0.1);83 // setPosition(Vector2(0.3, 0.55));84 // std::stringstream sstm;85 // sstm << "Level " << Level;86 // this->setCaption(sstm.str()); // + level87 // }88 // else89 // {90 // setTextSize(0.04);91 // setPosition(Vector2(0.14, 0.055));92 // this->setCaption(Level);93 // }94 69 // } 95 70 if(this->bShowPoints_) … … 99 74 { 100 75 setTextSize(0.2); 101 setPosition(Vector2(0.1, 0. 25));76 setPosition(Vector2(0.1, 0.02)); 102 77 this->setCaption("Final score:\n" + points); 103 78 this->setColour(ColourValue(1, 0, 0, 1)); … … 106 81 { 107 82 setTextSize(0.04); 108 setPosition(Vector2(0.14, 0. 1));83 setPosition(Vector2(0.14, 0.02)); 109 84 this->setColour(ColourValue(1, 1, 1, 1)); 110 85 this->setCaption(points); 111 86 } 112 87 } 113 // else if(this->bShowMultiplier_) 114 // { 115 // int mult = this->FlappyOrxGame->getMultiplier(); 116 // const std::string& Multiplier = "X " + multi_cast<std::string>(mult); 117 // this->setCaption(Multiplier); 118 // this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f))); 119 // this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01f + 0.04f); 120 // } 88 121 89 } 122 90 }
Note: See TracChangeset
for help on using the changeset viewer.