Changeset 12029
- Timestamp:
- Oct 10, 2018, 3:36:53 PM (6 years ago)
- Location:
- code/branches/mergeFS18
- Files:
-
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/mergeFS18
- Property svn:mergeinfo changed
/code/branches/RacingBots_FS18 (added) merged: 11817,11840-11841,11857,11860,11893,11912-11913,11938,11964-11969,11977,11982,11986,11989,11997
- Property svn:mergeinfo changed
-
code/branches/mergeFS18/data/levels/newnewnewspacerace.oxw
r11808 r12029 21 21 22 22 include("templates/spaceshipAssff.oxt") 23 include("templates/ pickupRepresentationTemplates.oxt")23 include("templates/SpaceRaceTemplates.oxt") 24 24 25 25 ?> … … 218 218 </StaticEntity> 219 219 220 <StaticEntity position="1 0000,-70,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static">220 <StaticEntity position="11000,-60,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static"> 221 221 <attached> 222 222 <Model scale="20" mesh="Board2.mesh" /> … … 233 233 234 234 <!-- distance = how far from the middle point of a check point do i have to fly ? distance variable answers this question --> 235 236 237 235 238 236 239 … … 246 249 </collisionShapes> 247 250 </RaceCheckPoint> 248 249 251 <Model mesh="cube.mesh" scale=2 position="3000,200,100"/> 252 <Model mesh="cube.mesh" scale=2 position="5000,100,500"/> 250 253 251 254 <RaceCheckPoint name="checkpoint2" yaw=90 pitch=90 position="3000,200,100" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1"> … … 262 265 263 266 264 <RaceCheckPoint name="checkpoint3" yaw=90 pitch=90 position="5000, 100,500" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">267 <RaceCheckPoint name="checkpoint3" yaw=90 pitch=90 position="5000,80,500" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1"> 265 268 <attached> 266 269 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 288 291 289 292 290 <RaceCheckPoint name="checkpoint5" yaw=90 pitch=90 position="1 0000,-200,200" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">291 <attached> 292 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 293 </attached> 294 <collisionShapes> 295 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 296 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 297 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 298 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 299 </collisionShapes> 300 </RaceCheckPoint> 301 302 303 304 <RaceCheckPoint name="checkpoint6" yaw=90 pitch=90 position="13000, 200,400" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">305 <attached> 306 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 307 </attached> 308 <collisionShapes> 309 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 310 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 311 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 312 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 313 </collisionShapes> 314 </RaceCheckPoint> 315 316 317 318 <RaceCheckPoint name="checkpoint7" yaw=90 pitch=90 position="15 000,0,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">293 <RaceCheckPoint name="checkpoint5" yaw=90 pitch=90 position="11000,-200,200" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1"> 294 <attached> 295 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 296 </attached> 297 <collisionShapes> 298 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 299 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 300 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 301 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 302 </collisionShapes> 303 </RaceCheckPoint> 304 305 306 307 <RaceCheckPoint name="checkpoint6" yaw=90 pitch=90 position="13000,-70,350" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1"> 308 <attached> 309 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 310 </attached> 311 <collisionShapes> 312 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 313 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 314 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 315 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 316 </collisionShapes> 317 </RaceCheckPoint> 318 319 320 321 <RaceCheckPoint name="checkpoint7" yaw=90 pitch=90 position="15500,0,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1"> 319 322 <attached> 320 323 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 353 356 </collisionShapes> 354 357 </RaceCheckPoint> 355 356 358 <RaceCheckPoint name="checkpoint10" yaw=90 pitch=90 position="24000,-150,-80" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1"> 357 359 <attached> … … 380 382 381 383 382 <RaceCheckPoint name="checkpoint12" yaw=90 pitch=90 position="30000,- 300,900" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">383 <attached> 384 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 385 </attached> 386 <collisionShapes> 387 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 388 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 389 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 390 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 391 </collisionShapes> 392 </RaceCheckPoint> 393 394 395 <RaceCheckPoint name="checkpoint13" yaw=90 pitch=90 position="33000, 600,60" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">396 <attached> 397 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 398 </attached> 399 <collisionShapes> 400 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 401 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 402 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 403 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 404 </collisionShapes> 405 </RaceCheckPoint> 406 407 408 409 <RaceCheckPoint name="checkpoint14" yaw=90 pitch=90 position="35000, 120,20" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="13" islast="false" nextcheckpoints="14,-1,-1">410 <attached> 411 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 412 </attached> 413 <collisionShapes> 414 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 415 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 416 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 417 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 418 </collisionShapes> 419 </RaceCheckPoint> 420 421 <RaceCheckPoint name="checkpoint15" yaw=90 pitch=90 position="38000, -200,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="14" islast="false" nextcheckpoints="15,-1,-1">384 <RaceCheckPoint name="checkpoint12" yaw=90 pitch=90 position="30000,-250,670" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1"> 385 <attached> 386 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 387 </attached> 388 <collisionShapes> 389 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 390 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 391 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 392 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 393 </collisionShapes> 394 </RaceCheckPoint> 395 396 397 <RaceCheckPoint name="checkpoint13" yaw=90 pitch=90 position="33000,150,600" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1"> 398 <attached> 399 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 400 </attached> 401 <collisionShapes> 402 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 403 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 404 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 405 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 406 </collisionShapes> 407 </RaceCheckPoint> 408 409 410 411 <RaceCheckPoint name="checkpoint14" yaw=90 pitch=90 position="35000,500,300" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="13" islast="false" nextcheckpoints="14,-1,-1"> 412 <attached> 413 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 414 </attached> 415 <collisionShapes> 416 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 417 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 418 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 419 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 420 </collisionShapes> 421 </RaceCheckPoint> 422 423 <RaceCheckPoint name="checkpoint15" yaw=90 pitch=90 position="38000,150,150" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="14" islast="false" nextcheckpoints="15,-1,-1"> 422 424 <attached> 423 425 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 477 479 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 478 480 </collisionShapes> 479 </RaceCheckPoint> 481 </RaceCheckPoint> 480 482 481 483 <!-- the last checkpoint is bigger and red --> … … 490 492 <BoxCollisionShape position="-90,0,0" halfExtents="13, 13, 90" /> 491 493 </collisionShapes> 492 </RaceCheckPoint> 494 </RaceCheckPoint> 493 495 494 496 495 497 </checkpoints> 496 498 </SpaceRaceManager> 497 499 <Arrow> 500 <attached> 501 <Model scale="5" mesh="botpointer4.mesh"/> 502 </attached> 503 <controller> 504 <ArrowController accuracy = 10000> 505 <gpspoints> 506 <Model mesh="cube.mesh" scale=0 position="1000,30,0"/> 507 <Model mesh="cube.mesh" scale=0 position="3000,200,100"/> 508 <Model mesh="cube.mesh" scale=0 position="5000,80,500"/> 509 <Model mesh="cube.mesh" scale=0 position="8000,-150,150"/> 510 <Model mesh="cube.mesh" scale=0 position="11000,-200,200"/> 511 <Model mesh="cube.mesh" scale=0 position="13000,-70,350"/> 512 <Model mesh="cube.mesh" scale=0 position="15500,0,0"/> 513 <Model mesh="cube.mesh" scale=0 position="18000,150,-150"/> 514 <Model mesh="cube.mesh" scale=0 position="21000,200,-120"/> 515 <Model mesh="cube.mesh" scale=0 position="24000,-150,-80"/> 516 <Model mesh="cube.mesh" scale=0 position="27000,-200,0"/> 517 <Model mesh="cube.mesh" scale=0 position="30000,-250,670"/> 518 <Model mesh="cube.mesh" scale=0 position="33000,150,600"/> 519 <Model mesh="cube.mesh" scale=0 position="35000,500,300"/> 520 <Model mesh="cube.mesh" scale=0 position="38000,150,150"/> 521 <Model mesh="cube.mesh" scale=0 position="41000,30,-50"/> 522 <Model mesh="cube.mesh" scale=0 position="44000,90,0"/> 523 <Model mesh="cube.mesh" scale=0 position="47000,120,30"/> 524 <Model mesh="cube.mesh" scale=0 position="50000,0,100"/> 525 <Model mesh="cube.mesh" scale=0 position="53000,0,0"/> 526 527 528 529 530 531 532 </gpspoints> 533 </ArrowController> 534 </controller> 535 </Arrow> 498 536 499 537 500 538 <!-- ---------------------PickUps---------------------- --> 501 539 502 <PickupSpawner pickup=smallshrinkpickup position="10000,-200,200" triggerDistance="60" respawnTime="10" maxSpawnedItems="10" scale="8"/> 503 <PickupSpawner pickup=mediumboostpickup position="24000,-150,-80" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 504 <PickupSpawner pickup=smallboostpickup position="38000,-200,0" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 505 506 <PickupSpawner pickup=smallspeedpickup position="7000,-200,100" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 507 <PickupSpawner pickup=mediumshinkpickup position="16000,150,50" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 508 <PickupSpawner pickup=triplehealthspeedinvisibilitypickup position="41000,-300,100" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 540 541 <PickupSpawner pickup=mediumboostpickup position="24000,-165,-80" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 542 543 <PickupSpawner pickup=smallboostpickup position="42000,70,-30" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 544 <PickupSpawner pickup=smallspeedpickup position="32000,0,650" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 545 546 <PickupSpawner pickup=smallspeedpickup position="9000,-185,66" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 547 509 548 </Scene> 510 549 </Level> -
code/branches/mergeFS18/data/levels/presentationHS12.oxw
r11802 r12029 61 61 62 62 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 63 <SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />63 <SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" primaryThrust=1000 spawnclass=SpaceShip pawndesign=spaceshipescort /> 64 64 <!--SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=bigship /--> 65 65 <!--SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage /--> … … 328 328 roll = "180" 329 329 name = "collateralDamage" 330 radarname = "Collateral Damage" > 331 <!-- 330 radarname = "Collateral Damage" 332 331 pitch = "90" 333 yaw = "0"--> 332 yaw = "100" 333 primaryThrust = "2000"> 334 334 <attached> 335 335 <DockingTarget name="spaceShip" /> -
code/branches/mergeFS18/data/levels/templates/fastship.oxt
r11783 r12029 21 21 rotationThrust = 50 22 22 23 lift = 0 ;24 stallSpeed = 220 ;23 lift = 0 24 stallSpeed = 220 25 25 26 26 27 boostPower = 827 boostPower = 7.5 28 28 boostPowerRate = 3 29 boostRate = 829 boostRate = 7.5 30 30 boostCooldownDuration = 6 31 31 -
code/branches/mergeFS18/data/levels/templates/spaceshipCollateralDamage.oxt
r11052 r12029 19 19 shieldrechargewaittime = 1 20 20 21 primaryThrust = 100 21 primaryThrust = 1000 22 22 auxilaryThrust = 30 23 23 rotationThrust = 50 … … 29 29 boostPowerRate = 1 30 30 boostRate = 5 31 boostCooldownDuration = 1 031 boostCooldownDuration = 1 32 32 33 33 shakeFrequency = 15 … … 36 36 collisionType = "dynamic" 37 37 mass = 100 38 linearDamping = 0. 738 linearDamping = 0.5 39 39 angularDamping = 0.9999999 40 40 > -
code/branches/mergeFS18/src/libraries/tools/Timer.h
r12028 r12029 115 115 void run(); 116 116 117 117 118 /// Re-starts the timer: The executor will be called after @a interval seconds. 118 119 inline void startTimer() -
code/branches/mergeFS18/src/modules/gametypes/SpaceRace.cc
r11721 r12029 69 69 #include "SpaceRaceBot.h" 70 70 #include "items/Engine.h" 71 #include <vector> 71 #include <vector> 72 #include <iostream> 73 #include <string> 72 74 73 75 … … 83 85 this->cantMove_ = false; 84 86 this->bTimeIsUp_ = false; 85 86 87 this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race 88 this->bLost =false; 87 89 //we fixed the number of bots in order to have the same starting position all the time ! 88 90 } … … 101 103 startpos[4] =-40; 102 104 startpos[5] =100; 103 105 104 106 startpos[6] =100; 105 107 startpos[7] =-40; … … 117 119 118 120 this->spawnPlayersIfRequested(); 121 this->countdown_mode=true; 119 122 this->cantMove_ = true; 120 123 //players are unable to move while countdown is running … … 122 125 { 123 126 engine->setActive(false); 127 engine->addSpeedMultiply(1.7); 124 128 } 125 129 … … 138 142 } 139 143 140 std::string message("Use headphones to hear the countdown!"); 141 this->getGametypeInfo()->sendAnnounceMessage(message); 142 ChatManager::message(message); 143 144 //after 11 seconds , countdownFinished function is called to activate bots` engines 145 Timer* countdownTimer = new Timer(); 146 countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this))); 147 } 148 149 150 144 std::string message("Use headphones to hear the countdown! Press W for forward acceleration, press W+space for boost!"); 145 146 this->getGametypeInfo()->sendAnnounceMessage(message); 147 ChatManager::message(message); 148 149 150 151 152 } 153 154 // Counter in the beginning of the game 155 void SpaceRace::tick(float dt) { 156 SUPER(SpaceRace, tick, dt); 157 158 //countdown_mode is set true,when spawnIfRequested is called 159 if (countdown_mode) { 160 //10 seconds will be counted 161 this->time_passed -= dt; 162 163 //orxout() << "time: " <<(int) time_passed << "s" << endl; 164 165 std::string message=std::to_string((int)time_passed); 166 this->getGametypeInfo()->sendAnnounceMessage(message); 167 if (time_passed <= 1) { 168 169 this->countdownFinished(); 170 this->countdown_mode = false; 171 } 172 } 173 174 } 175 176 void SpaceRace::startmessage(int second){ 177 178 std::string message=std::to_string(second); 179 this->getGametypeInfo()->sendAnnounceMessage(message); 180 ChatManager::message(message); 181 182 183 184 } 151 185 152 186 void SpaceRace::end() 153 187 { 188 154 189 this->clock_.capture(); 155 190 int s = this->clock_.getSeconds(); 156 191 int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s); 157 192 std::string message; 158 159 193 if (this->bTimeIsUp_) 160 194 { 161 message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n" 162 + "You lose!"; 163 } 195 message = "TIME IS UP! YOU LOOSE!"; 196 } 197 else if(this->bLost){ 198 message = "YOU LOOSE!"; 199 200 } 201 164 202 else 165 203 { … … 167 205 + "." + multi_cast<std::string>(ms) + " seconds."; 168 206 } 207 169 208 if (!this->hasEnded()) 170 209 { 210 171 211 this->getGametypeInfo()->sendAnnounceMessage(message); 172 212 ChatManager::message(message); … … 183 223 int ms = this->clock_.getMilliseconds() % 1000; 184 224 185 186 187 const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 225 226 std::string message(player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 227 + " after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds."); 228 229 this->getGametypeInfo()->sendAnnounceMessage(message); 230 ChatManager::message(message); 231 /* const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 188 232 + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds."; 189 233 this->getGametypeInfo()->sendAnnounceMessage(message); 190 ChatManager::message(message); 234 ChatManager::message(message);*/ 235 191 236 192 237 } … … 195 240 { 196 241 197 std::string message("RACE STARTED "); 198 this->getGametypeInfo()->sendAnnounceMessage(message); 199 ChatManager::message(message); 242 std::string message("RACE STARTED"); 243 this->getGametypeInfo()->sendAnnounceMessage(message); 244 ChatManager::message(message); 245 200 246 201 247 202 248 for (Engine* engine : ObjectList<Engine>()) 203 249 engine->setActive(true); 250 251 std::string message2("Press W for forward acceleration, press W+space for boost!"); 252 this->getGametypeInfo()->sendAnnounceMessage(message2); 253 ChatManager::message(message2); 204 254 } 205 255 -
code/branches/mergeFS18/src/modules/gametypes/SpaceRace.h
r11720 r12029 42 42 #include "SpaceRaceManager.h" 43 43 44 44 45 namespace orxonox 45 46 { … … 54 55 55 56 public: 56 SpaceRace(Context* context); 57 SpaceRace(Context* context);//, SpaceRace* parentRace); 57 58 virtual ~SpaceRace() {} 58 59 … … 60 61 virtual void end() override; 61 62 virtual void countdownFinished(); 63 62 64 virtual void addBots(unsigned int amount) override; //<! overwrite function in order to bypass the addbots command. 65 virtual void tick(float dt) override; 66 virtual void startmessage(int second); 63 67 64 68 … … 79 83 inline Clock& getClock() 80 84 { return this->clock_; } 85 //inline void setParentRace(SpaceRace* parentRace) { this->parentRace = parentRace; } 81 86 82 87 virtual bool allowPawnHit(Pawn* victim, Pawn* originator) override; 83 88 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator) override; 84 89 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override; 90 bool countdown_mode = false; 91 float time_passed = 11.0f; 92 93 bool bLost=false; 85 94 86 95 private: 87 96 bool cantMove_; ///< Helper variable, used to stall the engines before the race starts. 88 97 std::map<PlayerInfo*, RaceCheckPoint*> checkpointReached_; ///< The number of the last check point reached by each player. 89 bool bTimeIsUp_; 98 bool bTimeIsUp_; ///< True if one of the check points is reached too late. 90 99 91 100 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. -
code/branches/mergeFS18/src/modules/gametypes/SpaceRaceController.cc
r11720 r12029 20 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 21 * 22 * Created on: Oct 8, 2012 22 * Created on: Oct 8, 2012findCheck 23 23 * Author: purgham 24 24 */ … … 30 30 #include "collisionshapes/CollisionShape.h" 31 31 #include "BulletCollision/CollisionShapes/btCollisionShape.h" 32 #include "SpaceRace.h" 32 33 33 34 … … 38 39 const int ADJUSTDISTANCE = 500; 39 40 const int MINDISTANCE = 5; 41 40 42 /* 41 43 * Idea: Find static Point (checkpoints the spaceship has to reach) … … 45 47 { 46 48 RegisterObject(SpaceRaceController); 49 //this->parentRace = nullptr; 50 47 51 std::vector<RaceCheckPoint*> checkpoints; 48 52 … … 63 67 64 68 int i; 65 for (i = -2; findCheckpoint(i) != nullptr; i--) 69 for (i = -2; findCheckpoint(i) != nullptr; i--) // WIESO? 66 70 { 67 71 continue; … … 103 107 return returnVec; 104 108 } 105 109 void SpaceRaceController::endtheGame() const { 110 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype()); 111 assert(gametype) 112 ; if (!gametype) 113 return; 114 gametype->bLost=true; 115 gametype->end(); 116 117 } 106 118 /* 107 119 * called from 'findStaticCheckpoints' … … 122 134 for (int checkpointIndex : currentCheckpoint->getNextCheckpoints()) 123 135 { 136 if (findCheckpoint(checkpointIndex) == nullptr){ 137 orxout(internal_warning) << "Problematic Point: " << checkpointIndex << endl; 138 } 124 139 if (currentCheckpoint == findCheckpoint(checkpointIndex)) 125 140 { 126 //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;141 orxout() << currentCheckpoint->getCheckpointIndex()<<endl; 127 142 continue; 128 143 } 129 if (findCheckpoint(checkpointIndex) == nullptr) 130 orxout(internal_warning) << "Problematic Point: " << checkpointIndex << endl; 144 131 145 else 132 146 numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(checkpointIndex), zaehler); 147 133 148 } 134 149 zaehler[currentCheckpoint] += numberOfWays; … … 162 177 { 163 178 RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex); 179 164 180 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 165 181 … … 168 184 minDistance = distance; 169 185 minNextRaceCheckPoint = nextRaceCheckPoint; 170 } 171 172 } 173 186 187 } 188 //There is a bug. If the user passes through the 19th checkpoint with the opponents, the game will end immediately 189 if(nextRaceCheckPoint->isLast()) 190 endtheGame(); 191 192 } 193 if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @192 SpaceRaceController" << endl;} 174 194 return minNextRaceCheckPoint; 175 195 } … … 208 228 209 229 { 230 if(nextRaceCheckpoint_ == nullptr) orxout()<<"nullptr found @218 SpaceRaceController" << endl; 231 210 232 return nextRaceCheckpoint_; 211 233 } … … 213 235 214 236 { 237 if(nextRaceCheckpoint_ == nullptr) orxout()<<"nullptr found @223 SpaceRaceController" << endl; 238 215 239 return nextRaceCheckpoint_; 216 240 } … … 221 245 } 222 246 247 248 249 250 251 223 252 RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const 224 253 { 225 for (RaceCheckPoint* checkpoint : this->checkpoints_) 226 if (checkpoint->getCheckpointIndex() == index) 227 return checkpoint; 228 return nullptr; 229 } 254 RaceCheckPoint* res = nullptr; 255 for (RaceCheckPoint* checkpoint : this->checkpoints_){ 256 //conclusion: index=20 is not 257 if (checkpoint->getCheckpointIndex() == index){ 258 //if(checkpoint == nullptr) orxout()<<"returned nullptr @line 234 SpaceRaceController"<<endl; 259 //orxout()<< "index of the checkpoint "<< index <<endl; 260 res = checkpoint; 261 return res; 262 } 263 } 264 /* if(index>2 ) 265 this->endtheGame();*/ 266 267 return res; 268 } 269 270 230 271 231 272 /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , const Vector3& virtualCheckPointPosition ) … … 282 323 void SpaceRaceController::tick(float dt) 283 324 { 325 326 284 327 if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr ) 285 328 { … … 312 355 { 313 356 nextRaceCheckpoint_ = adjustNextPoint(); 357 if(nextRaceCheckpoint_ == nullptr) orxout()<<"nullptr found @327 SpaceRaceController" << endl; 358 314 359 lastPositionSpaceship = this->getControllableEntity()->getPosition(); 315 360 } … … 325 370 } 326 371 //orxout(user_status) << "dt= " << dt << "; distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl; 327 lastPositionSpaceship = this->getControllableEntity()->getPosition(); 328 372 /*lastPositionSpaceship = this->getControllableEntity()->getPosition(); 373 374 SpaceRace obj=new SpaceRace(); 375 obj.setParentRace(parentRace); 376 this->parentRace=obj.parentRace;*/ 377 329 378 this->boostControl(); 379 380 /*if(nextRaceCheckpoint_ == nullptr){ 381 this->parentRace->bLost=true; 382 this->parentRace->end(); 383 }*/ 384 // if(nextRaceCheckpoint_ == nullptr ){ 385 // // if( nextRaceCheckpoint_->getCheckpointIndex()==19) 386 // orxout()<<"nullptr @351 Line"<<endl; 387 // } 388 389 330 390 this->moveToPosition(nextRaceCheckpoint_->getPosition()); 391 331 392 this->boostControl(); 332 393 } 333 394 395 396 /*void SpaceRaceController::setParentRace(parentRace){ 397 this->parentRace=parentRace; 398 }*/ 334 399 // True if a coordinate of 'pointToPoint' is smaller then the corresponding coordinate of 'groesse' 335 400 bool SpaceRaceController::vergleicheQuader(const Vector3& pointToPoint, const Vector3& groesse) -
code/branches/mergeFS18/src/modules/gametypes/SpaceRaceController.h
r11099 r12029 47 47 { 48 48 public: 49 SpaceRaceController(Context* context); 49 SpaceRaceController(Context* context);//, SpaceRace* parentRace); 50 50 virtual ~SpaceRaceController(); 51 51 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 52 52 virtual void tick(float dt) override; 53 53 54 54 55 private: … … 57 58 RaceCheckPoint* nextPointFind(RaceCheckPoint*); 58 59 RaceCheckPoint* adjustNextPoint(); 60 void endtheGame() const; 61 59 62 std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&); 60 63 std::vector<RaceCheckPoint*> staticCheckpoints(); … … 74 77 Vector3 lastPositionSpaceship; 75 78 int virtualCheckPointIndex; 79 //SpaceRace* parentRace; 76 80 }; 77 81 -
code/branches/mergeFS18/src/modules/gametypes/SpaceRaceManager.cc
r11071 r12029 113 113 RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const 114 114 { 115 for (RaceCheckPoint* checkpoint : this->checkpoints_)115 /*for (RaceCheckPoint* checkpoint : this->checkpoints_) 116 116 if (checkpoint->getCheckpointIndex() == index) 117 117 return checkpoint; 118 return nullptr;*/ 119 for (RaceCheckPoint* checkpoint : this->checkpoints_){ 120 if (checkpoint->getCheckpointIndex() == index) 121 return checkpoint; 122 } 123 orxout()<<"returned checkpoint @line 123 SpaceRaceManager"<<endl; 118 124 return nullptr; 119 125 } -
code/branches/mergeFS18/src/orxonox/items/Engine.cc
r11071 r12029 54 54 this->relativePosition_ = Vector3::ZERO; 55 55 56 this->boostFactor_ = 1. 5f;56 this->boostFactor_ = 1.2f; 57 57 58 58 this->maxSpeedFront_ = 0.0f; … … 61 61 this->maxSpeedUpDown_ = 0.0f; 62 62 63 this->accelerationFront_ = 0.0f;63 this->accelerationFront_ = 1.0f; 64 64 this->accelerationBrake_ = 0.0f; 65 65 this->accelerationBack_ = 0.0f; … … 68 68 69 69 this->speedAdd_ = 0.0f; 70 this->speedMultiply_ = 1.0f; 70 this->speedMultiply_ = 1.0f; ////////////////////////////////////////// 71 71 72 72 this->setConfigValues(); -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/SpaceShip.cc
r12028 r12029 65 65 this->boostPowerRate_ = 1.0f; 66 66 this->boostRate_ = 5.0f; 67 this->boostCooldownDuration_ = 5.0f;67 this->boostCooldownDuration_ = 10.0f; 68 68 69 69 this->shakeFrequency_ = 15.0f; -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/SpaceShip.h
r12028 r12029 103 103 */ 104 104 virtual void moveFrontBack(const Vector2& value) 105 { this->steering_.z -= value.x; }105 { this->steering_.z -= (0.6)*value.x; } 106 106 /** 107 107 @brief Move right or left. … … 109 109 */ 110 110 virtual void moveRightLeft(const Vector2& value) 111 { this->steering_.x += value.x; }111 { this->steering_.x += (0.6)*value.x; } 112 112 /** 113 113 @brief Move up or down. … … 115 115 */ 116 116 virtual void moveUpDown(const Vector2& value) 117 { this->steering_.y += value.x; }117 { this->steering_.y += (0.6)*value.x; } 118 118 119 119 inline void moveFrontBack(float value)
Note: See TracChangeset
for help on using the changeset viewer.