- Timestamp:
- Apr 12, 2018, 4:09:58 PM (7 years ago)
- Location:
- code/branches/RacingBots_FS18
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
r11783 r11857 229 229 230 230 <!-- distance = how far from the middle point of a check point do i have to fly ? distance variable answers this question --> 231 232 233 231 234 232 235 … … 491 494 </checkpoints> 492 495 </SpaceRaceManager> 493 496 <Arrow> 497 <attached> 498 <Model scale="5" mesh="tutorialpointer3.mesh"/> 499 </attached> 500 <controller> 501 <ArrowController accuracy = 2000> 502 <gpspoints> 503 <Model mesh="cube.mesh" scale=1.5 position="1000,30,0"/> 504 <Model mesh="cube.mesh" scale=1.5 position="3000,200,100"/> 505 <Model mesh="cube.mesh" scale=1.5 position="5000,100,500"/> 506 <Model mesh="cube.mesh" scale=1.5 position="8000,-150,150"/> 507 <Model mesh="cube.mesh" scale=1.5 position="10000,-200,200"/> 508 <Model mesh="cube.mesh" scale=1.5 position="13000,200,400"/> 509 <Model mesh="cube.mesh" scale=1.5 position="15000,0,0"/> 510 <Model mesh="cube.mesh" scale=1.5 position="18000,150,-150"/> 511 <Model mesh="cube.mesh" scale=1.5 position="21000,200,-120"/> 512 <Model mesh="cube.mesh" scale=1.5 position="24000,-150,-80"/> 513 <Model mesh="cube.mesh" scale=1.5 position="27000,-200,0"/> 514 <Model mesh="cube.mesh" scale=1.5 position="30000,-300,900"/> 515 <Model mesh="cube.mesh" scale=1.5 position="33000,600,60"/> 516 <Model mesh="cube.mesh" scale=1.5 position="35000,120,20"/> 517 <Model mesh="cube.mesh" scale=1.5 position="38000,-200,0"/> 518 <Model mesh="cube.mesh" scale=1.5 position="41000,30,-50"/> 519 <Model mesh="cube.mesh" scale=1.5 position="44000,90,0"/> 520 <Model mesh="cube.mesh" scale=1.5 position="47000,120,30"/> 521 <Model mesh="cube.mesh" scale=1.5 position="50000,0,100"/> 522 <Model mesh="cube.mesh" scale=1.5 position="53000,0,0"/> 523 524 525 526 </gpspoints> 527 </ArrowController> 528 </controller> 529 </Arrow> 494 530 495 531 -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
r11841 r11857 119 119 120 120 this->spawnPlayersIfRequested(); 121 this->countdown_mode=true; 121 122 this->cantMove_ = true; 122 123 //players are unable to move while countdown is running … … 145 146 ChatManager::message(message); 146 147 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 186 154 void SpaceRace::tick(float dt) { 187 155 SUPER(SpaceRace, tick, dt); 188 this->time_passed -= dt;189 156 157 //countdown_mode is set true,when spawnIfRequested is called 190 158 if (countdown_mode) { 159 //10 seconds will be counted 160 this->time_passed -= dt; 191 161 192 162 //orxout() << "time: " <<(int) time_passed << "s" << endl; 163 193 164 std::string message=std::to_string((int)time_passed); 194 165 this->getGametypeInfo()->sendAnnounceMessage(message); 195 166 if (time_passed <= 1) { 167 196 168 this->countdownFinished(); 197 169 this->countdown_mode = false; … … 210 182 211 183 } 212 213 184 214 185 void SpaceRace::end() -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h
r11841 r11857 86 86 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator) override; 87 87 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; 90 90 91 91 private:
Note: See TracChangeset
for help on using the changeset viewer.