Changeset 11563 for code/branches/FlappyOrx_HS17
- Timestamp:
- Nov 20, 2017, 1:06:08 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/data/levels/FlappyOrx.oxw
r11554 r11563 42 42 43 43 <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> --> 44 <Light type=directional position="1100 , 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />44 <Light type=directional position="11000, 11000, -7000" lookat="0, 0, 0" diffuse="1, 1, 1, 1" specular="1.0, 0.9, 0.9, 1.0" /> 45 45 <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=FlappyOrxShip pawndesign=spaceshipFlappyOrx /> 46 46 -
code/branches/FlappyOrx_HS17/data/overlays/FlappyOrxHUD.oxo
r11533 r11563 15 15 align = "left" 16 16 17 showlives = false18 17 showpoints = true 18 /> 19 20 <FlappyOrxHUDinfo 21 position = "0.02, 0.01" 22 pickpoint = "0.0, 0.0" 23 font = "ShareTechMono" 24 textsize = 0.04 25 colour = "1.0, 1.0, 1.0, 1.0" 26 align = "left" 27 28 showmessage = true 19 29 /> 20 30 … … 26 36 colour = "1.0, 1.0, 1.0, 1.0" 27 37 align = "left" 28 caption = " Points: "38 caption = "Score: " 29 39 /> 30 40 <!-- <FlappyOrxHUDinfo -
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.