Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2018, 4:09:58 PM (7 years ago)
Author:
andera
Message:

the counter in the beginning of the game has been editted. New checkpoint pointer has been added. New arrow is made in blender but not uploaded yet

Location:
code/branches/RacingBots_FS18/src/modules/gametypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc

    r11841 r11857  
    119119
    120120        this->spawnPlayersIfRequested();
     121        this->countdown_mode=true;
    121122        this->cantMove_ = true;
    122123        //players are unable to move while countdown is running
     
    145146        ChatManager::message(message);
    146147       
    147        
    148         /*for(int i=10; i>0;i=i-1){
    149             startmessage(i);
    150         }*/
    151 
    152 
    153         //after 11 seconds , countdownFinished function is called to activate bots` engines
    154         //Timer* countdownTimer = new Timer();
    155         //countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));
    156 
    157         /*
    158         while(countdownTimer->getRemainingTime()!=0){
    159             if(countdownTimer->getRemainingTime()==1){
    160                 startmessage(1);
    161             }
    162         }*/
    163        
    164 
    165 
    166 
    167        
    168 
    169        
    170         /*unsigned long long float time_notification=countdownTimer.getRealMicroSeconds();
    171         while(this->bTimeIsUp_==false){
    172 
    173         std::ostream stream;
    174         stream<<time_notification;
    175         std::string chat_notification(stream.str());
    176         this->getGametypeInfo()->sendAnnounceMessage(chat_notification);
    177         ChatManager::message(chat_notification);
    178 
    179         }*/
    180 
    181        
    182     }
    183 
    184    
    185 
     148
     149
     150       
     151    }
     152
     153    // Counter in the beginning of the game
    186154    void SpaceRace::tick(float dt) {
    187155        SUPER(SpaceRace, tick, dt);
    188         this->time_passed -= dt;
    189 
     156       
     157        //countdown_mode is set true,when spawnIfRequested is called
    190158        if (countdown_mode) {
     159            //10 seconds will be counted
     160            this->time_passed -= dt;
    191161
    192162            //orxout() << "time: " <<(int) time_passed << "s" << endl;
     163
    193164            std::string message=std::to_string((int)time_passed);
    194165            this->getGametypeInfo()->sendAnnounceMessage(message);
    195166            if (time_passed <= 1) {
     167
    196168                this->countdownFinished();
    197169                this->countdown_mode = false;
     
    210182
    211183    }
    212 
    213184
    214185    void SpaceRace::end()
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h

    r11841 r11857  
    8686            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator) override;
    8787            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override;
    88             bool countdown_mode = true;
    89             float time_passed = 11.0f;
     88            bool countdown_mode = false;
     89            float time_passed = 4.0f;
    9090
    9191        private:
Note: See TracChangeset for help on using the changeset viewer.