Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2014, 3:05:46 PM (10 years ago)
Author:
fvultier
Message:

new items added. improved level generator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickupsFS14/src/modules/jump/JumpScore.cc

    r10050 r10074  
    5555        RegisterObject(JumpScore);
    5656
    57         this->owner_ = NULL;
    58 
     57        owner_ = NULL;
     58        showScore_ = false;
     59        showMessages_ = false;
    5960    }
    6061
     
    7576    {
    7677        SUPER(JumpScore, XMLPort, xmlelement, mode);
     78
     79        XMLPortParam(JumpScore, "showScore", setShowScore, getShowScore, xmlelement, mode);
     80        XMLPortParam(JumpScore, "showMessages", setShowMessages, getShowMessages, xmlelement, mode);
     81        XMLPortParam(JumpScore, "gameOverText", setGameOverText, getGameOverText, xmlelement, mode);
    7782    }
    7883
     
    9297        if (this->owner_ != NULL)
    9398        {
    94                 /*
    95             if (!this->owner_->hasEnded())
    96             {
    97                 // Get the two players.
    98                 player1_ = this->owner_->getPlayer();
    99             }
    100 
    101             std::string name1;
    102 
    103             std::string score1("0");
    104 
    105             // Save the name and score of each player as a string.
    106             if (player1_ != NULL)
    107             {
    108                 name1 = player1_->getName();
    109                 score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
    110             }
    111 
    112             // Assemble the strings, depending on what should all be displayed.
    113             std::string output1;
    114             if (this->bShowLeftPlayer_)
    115             {
    116                 if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)
    117                     output1 = name1 + " - " + score1;
    118                 else if (this->bShowScore_)
    119                     output1 = score1;
    120                 else if (this->bShowName_)
    121                     output1 = name1;
    122             }
    123 
    124             std::string output("JUMP");
    125             if (this->bShowName_ || this->bShowScore_)
    126             {
    127                 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
    128                     output = output1 + ':' + output2;
    129                 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
    130                     output = output1 + output2;
    131             }
    132 
    133             this->setCaption(output);*/
    134 
    135 
    136 
    137 
    13899            if (!owner_->hasEnded())
    139100            {
     
    142103                if (player_ != NULL)
    143104                {
    144                         int score = owner_->getScore(player_);
     105                        if (showScore_ == true)
     106                        {
     107                        int score = owner_->getScore(player_);
    145108
    146                         std::string str = multi_cast<std::string>(score);
    147                         setCaption(str);
     109                        std::string str = multi_cast<std::string>(score);
     110                        setCaption(str);
     111                        }
     112                        else if (showMessages_ == true)
     113                        {
     114
     115                        setCaption(owner_->getDead(player_) == true ? gameOverText_ : "");
     116                        }
    148117                }
    149118            }
Note: See TracChangeset for help on using the changeset viewer.