Changeset 11272 for code/branches
- Timestamp:
- Nov 7, 2016, 4:00:25 PM (8 years ago)
- Location:
- code/branches/SpaceRace_HS16
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw
r11260 r11272 220 220 221 221 <!-- ------------------CheckPoints----------------- --> 222 <OldRaceCheckPoint name="checkpoint1" direction="0,2,0" position="800,20,0" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">222 <OldRaceCheckPoint name="checkpoint1" direction="0,2,0" position="800,20,0" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false"> 223 223 <attached> 224 224 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 303 303 </collisionShapes> 304 304 </OldRaceCheckPoint> 305 306 307 308 <!-- <SpaceRaceManager> 309 <checkpoints> 310 <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1"> 311 <attached> 312 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> 313 314 315 <Model position="0,0,55" mesh="testcube.mesh" scale3D="110,20,20" /> 316 <Model position="0,0,-55" mesh="testcube.mesh" scale3D="110,20,20" /> 317 <Model position="55,0,0" mesh="testcube.mesh" scale3D="20,20,110" /> 318 <Model position="-55,0,0" mesh="testcube.mesh" scale3D="20,20,110" /> 319 320 321 322 323 </attached> 324 325 326 327 <collisionShapes> 328 329 330 <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" /> 331 <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" /> 332 <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" /> 333 <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" /> 334 335 336 </collisionShapes> 337 338 339 340 341 </RaceCheckPoint> 342 343 <RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1"> 344 <attached> 345 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> 346 </attached> 347 348 349 <collisionShapes> 350 351 <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" /> 352 <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" /> 353 <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" /> 354 <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" /> 355 356 </collisionShapes> 357 </RaceCheckPoint> 358 359 360 </checkpoints> 361 </SpaceRaceManager> --> 362 363 305 364 306 365 </Scene> 307 366 </Level> 367 -
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.cc
r11260 r11272 36 36 #include "items/Engine.h" 37 37 #include "controllers/HumanController.h" 38 #include "SpaceRaceBot.h"39 38 40 39 #include "core/CoreIncludes.h" … … 43 42 #include "worldentities/pawns/Pawn.h" 44 43 #include "core/config/ConfigValueIncludes.h" 44 #include "infos/Bot.h" 45 #include "SpaceRaceBot.h" 45 46 46 47 … … 56 57 57 58 //this->botclass_ = Class(); 59 this->botclass_ = Class(SpaceRaceBot);//ClassByString("") 58 60 59 61 this->checkpointsReached_ = 0; … … 168 170 } 169 171 172 /*void playerEntered(PlayerInfo* player) { 173 174 175 Gametype::playerEntered(player); 176 177 const std::string& message = player->getName() + " entered the game"; 178 ChatManager::message(message); 179 180 }*/ 181 182 183 184 185 void OldSpaceRace::addBots(unsigned int amount) 186 { 187 for (unsigned int i = 0; i < amount; ++i) 188 this->botclass_.fabricate(this->getContext()); 189 } 190 191 192 193 170 194 171 195 } -
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.h
r11256 r11272 38 38 39 39 #include "gametypes/Gametype.h" 40 #include "SpaceRaceManager.h" 40 41 41 42 #include "OldRaceCheckPoint.h" … … 63 64 virtual void playerEntered(PlayerInfo* player) override; 64 65 virtual void newCheckpointReached(); 65 virtual void addBots(unsigned int amount) override {}//<! overwrite function in order to bypass the addbots command.66 virtual void addBots(unsigned int amount) override; //<! overwrite function in order to bypass the addbots command. 66 67 //<! This is only a temporary solution. Better: create racingBots. 67 68 -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.cc
r11256 r11272 23 23 * Author: purgham 24 24 */ 25 #include <vector> 25 26 26 27 #include "SpaceRaceBot.h" 28 #include "core/GameMode.h" 27 29 #include "core/CoreIncludes.h" 30 #include "core/config/ConfigValueIncludes.h" 31 #include "gametypes/Gametype.h" 32 #include "controllers/AIController.h" 33 #include "gametypes/SpaceRaceController.h" 34 35 28 36 29 37 namespace orxonox … … 33 41 SpaceRaceBot::SpaceRaceBot(Context* context) : Bot(context){ 34 42 RegisterObject(SpaceRaceBot); 35 this->defaultController_ = Class(SpaceRaceController);// ClassByString("") 36 this->createController(); 37 } 43 this->defaultController_ = Class(AIController);// ClassByString("") 44 38 45 39 46 … … 41 48 42 49 50 this->createController(); 51 52 } 53 54 SpaceRaceBot::~SpaceRaceBot(){ 55 56 } 57 58 void SpaceRaceBot::setConfigValues() 59 { 60 static const std::string names[] = 61 { 62 "Dr. Julius No", 63 "Berkay Berabi", 64 "Louis Meile" 65 66 "Dominic Greene" 67 }; 68 static std::vector<std::string> defaultnames(names, names + sizeof(names) / sizeof(std::string)); 69 70 SetConfigValue(names_, defaultnames); 71 } 72 43 73 44 74 -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.h
r11239 r11272 30 30 #include "gametypes/GametypesPrereqs.h" 31 31 #include "gametypes/SpaceRaceController.h" 32 #include <vector> 32 33 33 34 … … 35 36 { 36 37 37 /**38 /sdaasdasdasdasdas39 */40 38 class _GametypesExport SpaceRaceBot: public Bot 41 39 { 42 40 public: 43 SpaceRaceBot(Context* context); 44 virtual ~SpaceRaceBot() {} 41 SpaceRaceBot(Context* context); 42 virtual ~SpaceRaceBot(); 43 44 void setConfigValues(); 45 46 47 48 virtual inline bool isInitialized() const override 49 { return true; } 50 virtual inline float getPing() const override 51 { return 0; } 52 virtual inline float getPacketLossRatio() const override 53 { return 0; } 54 55 56 private: 57 std::vector<std::string> names_; 58 59 45 60 }; 46 61 } -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceManager.cc
r11071 r11272 47 47 RegisterObject(SpaceRaceManager); 48 48 this->race_ = orxonox_cast<SpaceRace*>(this->getGametype()); 49 assert(race_);49 //assert(race_); 50 50 //amountOfPlayers=(race_->getPlayers()).size(); 51 51 this->firstcheckpointvisible_ = false; -
code/branches/SpaceRace_HS16/src/orxonox/gametypes/Gametype.cc
r11071 r11272 96 96 } 97 97 } 98 98 99 99 /** 100 100 * @brief Initializes sub-objects of the Gametype. This must be called after the constructor.
Note: See TracChangeset
for help on using the changeset viewer.