Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 20, 2017, 1:06:08 PM (8 years ago)
Author:
pascscha
Message:

death message initiated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.cc

    r11533 r11563  
    4545        this->bShowPoints_ = false;
    4646        this->bShowMultiplier_ = false;
     47        this->bShowGameOver_ = false;
     48        this->sGameOverMessage_ = "";
    4749    }
    4850
     
    5254
    5355        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);
    5558       
    5659   
     
    7174            {
    7275                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())
    8177                {
    8278                    setTextSize(0.04);
     
    8581                    this->setCaption(points);
    8682                }
     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
    8793            }
    8894           
Note: See TracChangeset for help on using the changeset viewer.