Changeset 11563 for code/branches/FlappyOrx_HS17/src/modules
- Timestamp:
- Nov 20, 2017, 1:06:08 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17/src/modules/flappyorx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
r11554 r11563 51 51 #include "core/command/ConsoleCommand.h" 52 52 #include "worldentities/ExplosionPart.h" 53 53 54 54 55 namespace orxonox … … 198 199 }; 199 200 201 bool FlappyOrx::isDead(){ 202 return true; 203 } 204 205 std::string FlappyOrx::getDeathMessage(){ 206 return "hello world"; 207 } 208 200 209 void FlappyOrx::comboControll() 201 210 { -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
r11537 r11563 88 88 // checks if multiplier should be reset. 89 89 void comboControll(); 90 91 bool isDead(); 92 std::string getDeathMessage(); 93 90 94 int lives; 91 95 int multiplier; -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.cc
r11533 r11563 45 45 this->bShowPoints_ = false; 46 46 this->bShowMultiplier_ = false; 47 this->bShowGameOver_ = false; 48 this->sGameOverMessage_ = ""; 47 49 } 48 50 … … 52 54 53 55 XMLPortParam(FlappyOrxHUDinfo, "showlives", setShowLives, getShowLives, xmlelement, mode).defaultValues(false); 54 XMLPortParam(FlappyOrxHUDinfo, "showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false); 56 XMLPortParam(FlappyOrxHUDinfo, "showpoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false); 57 XMLPortParam(FlappyOrxHUDinfo, "showmessage", setShowMessage, getShowMessage, xmlelement, mode).defaultValues(false); 55 58 56 59 … … 71 74 { 72 75 const std::string& points = multi_cast<std::string>(this->FlappyOrxGame->getPoints()); 73 if (this->FlappyOrxGame->lives <= 0) 74 { 75 setTextSize(0.2); 76 setPosition(Vector2(0.1, 0.02)); 77 this->setCaption("Final score:\n" + points); 78 this->setColour(ColourValue(1, 0, 0, 1)); 79 } 80 else 76 if (not this->FlappyOrxGame->isDead()) 81 77 { 82 78 setTextSize(0.04); … … 85 81 this->setCaption(points); 86 82 } 83 } 84 if(this->bShowGameOver_){ 85 if(this->FlappyOrxGame->isDead()){ 86 std::string message = this->FlappyOrxGame->getDeathMessage(); 87 setTextSize(0.4); 88 setPosition(Vector2(.5, .5)); 89 this->setCaption(message); 90 this->setColour(ColourValue(1, 0, 0, 1)); 91 } 92 87 93 } 88 94 -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.h
r11521 r11563 32 32 #include "tools/interfaces/Tickable.h" 33 33 #include "overlays/OverlayText.h" 34 #include <cstring> 34 35 35 36 namespace orxonox … … 64 65 { return this->bShowMultiplier_; } 65 66 67 inline void setShowMessage(bool value){ 68 bShowGameOver_ = value; 69 } 70 inline bool getShowMessage() const 71 { return this->bShowGameOver_; } 72 66 73 67 74 private: … … 71 78 bool bShowPoints_; 72 79 bool bShowMultiplier_; 80 bool bShowGameOver_; 81 std::string sGameOverMessage_; 73 82 }; 74 83 }
Note: See TracChangeset
for help on using the changeset viewer.