- Timestamp:
- Dec 3, 2013, 8:18:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc
r9866 r9868 47 47 } 48 48 49 InvaderHUDinfo::~InvaderHUDinfo()50 {51 }52 53 49 void InvaderHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode) 54 50 { … … 75 71 { 76 72 const std::string& Level = multi_cast<std::string>(this->InvaderGame->getLevel()); 77 this->setCaption(Level); 73 if (this->InvaderGame->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 press space."); 77 setTextSize(0.05); 78 this->InvaderGame->bEndGame = true; 79 } 80 else 81 { 82 setTextSize(0.04); 83 setPosition(Vector2(0.14, 0.055)); 84 this->setCaption(Level); 85 } 78 86 } 79 87 else if(this->bShowPoints_) … … 82 90 if (this->InvaderGame->lives <= 0) 83 91 { 84 setTextSize(0.1); 85 setPosition(Vector2(0.2, 0.5)); 92 setTextSize(0.2); 93 setPosition(Vector2(0.1, 0.25)); 94 this->setCaption("Final score:\n" + points); 95 this->setColour(ColourValue(1, 0, 0, 1)); 86 96 } 87 this->setCaption(points); 97 else 98 { 99 setTextSize(0.04); 100 setPosition(Vector2(0.14, 0.1)); 101 this->setColour(ColourValue(1, 1, 1, 1)); 102 this->setCaption(points); 103 } 88 104 } 89 105 else if(this->bShowMultiplier_) 90 106 { 91 const std::string& Multiplier = multi_cast<std::string>(this->InvaderGame->getMultiplier()); 107 int mult = this->InvaderGame->getMultiplier(); 108 const std::string& Multiplier = "X " + multi_cast<std::string>(mult); 92 109 this->setCaption(Multiplier); 110 this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f))); 111 this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01 + 0.04); 93 112 } 94 113 }
Note: See TracChangeset
for help on using the changeset viewer.