Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2013, 8:18:15 PM (12 years ago)
Author:
zifloria
Message:

End game screen. Eye candy. Gameplay tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc

    r9866 r9868  
    4747    }
    4848
    49     InvaderHUDinfo::~InvaderHUDinfo()
    50     {
    51     }
    52 
    5349    void InvaderHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5450    {
     
    7571            {
    7672                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                }
    7886            }
    7987            else if(this->bShowPoints_)
     
    8290                if (this->InvaderGame->lives <= 0)
    8391                {
    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));
    8696                }
    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                }
    88104            }
    89105            else if(this->bShowMultiplier_)
    90106            {
    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);
    92109                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);
    93112            }
    94113        }
Note: See TracChangeset for help on using the changeset viewer.