Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2011, 10:03:32 PM (13 years ago)
Author:
msalomon
Message:

RaceCheckPoints with a time limit and the version of the level for the presentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spacerace/src/modules/gametypes/SpaceRace.h

    r8552 r8616  
    4040namespace orxonox
    4141{
    42 /*    class PlayerScore {
    43         public:
    44             PlayerScore() {
    45                 this->name = "";
    46                 this->time =0;
    47             }
    48             PlayerScore(std::string name, float time) {
    49                 this->name_ = name;
    50                 this->time_ = time;
    51             }
    52             PlayerScore(float time) {
    53                 this->name_ = "Player";
    54                 this->time_ = time;
    55             }
    56        
    57         private:
    58             std::string name_;
    59             float time_;
    60     };*/
    61        
     42  /**
     43  @brief
     44  The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
     45  */
    6246    class _OrxonoxExport SpaceRace : public Gametype
    6347    {
     
    7458           
    7559            inline void setCheckpointsReached(int n)
    76                 { this->checkpointsReached_ = n;}
     60                { this->bCheckpointsReached_ = n;}
    7761            inline int getCheckpointsReached()
    78                 { return this->checkpointsReached_; }
     62                { return this->bCheckpointsReached_; }
    7963            inline void timeIsUp()
    8064                { this->bTimeIsUp_ = true;}
    81            
     65            Clock *clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
    8266        protected:
    8367           
    8468        private:
    85             int checkpointsReached_;
    86             std::set<float> scores_;
    87             Clock *clock_;
    88             bool bTimeIsUp_;
     69            int bCheckpointsReached_; //The current number of check points reached by the player.
     70            std::set<float> scores_; //The times of the players are saved in a set.
     71            bool bTimeIsUp_; //True if one of the check points is reached too late.
    8972    };
    9073}
Note: See TracChangeset for help on using the changeset viewer.