Changeset 8949
- Timestamp:
- Nov 23, 2011, 4:16:15 PM (13 years ago)
- Location:
- code/branches/spaceraceTwo
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
r8944 r8949 53 53 </SpaceRaceManager> 54 54 55 55 <SpaceShip position="0,2000,2000" lookat="0,0,0" team=1 > 56 <templates> 57 <Template link=spaceshipassff /> 58 </templates> 59 <controller> 60 <WaypointPatrolController alertnessradius=1500 team=0 > 61 <waypoints> 62 <Model scale=0 position="0,2000,2000" /> 63 </waypoints> 64 </WaypointPatrolController> 65 </controller> 66 </SpaceShip> 56 67 57 68 -
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
r8940 r8949 39 39 { 40 40 CreateFactory(RaceCheckPoint); 41 42 41 43 42 44 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)) 43 45 { 44 46 RegisterObject(RaceCheckPoint); 45 47 48 49 46 50 this->bCheckpointIndex_ = 0; 47 51 //this->bIsLast_ = false; 48 52 this->bTimeLimit_ = 0; 49 this->isVisible_= false;53 this->isVisible_=true; 50 54 51 55 this->setRadarObjectColour(ColourValue::Blue); 52 56 this->setRadarObjectShape(RadarViewable::Triangle); 53 this->setRadarVisibility( false);57 this->setRadarVisibility(true); 54 58 } 55 59 … … 58 62 //if (this->isInitialized()) 59 63 { 60 //for (size_t i = 0; i < this->nextcheckpoints_.size(); ++i)61 //this->nextcheckpoints_[i]->destroy();64 //for (size_t i = 0; i < 3; ++i) 65 // this->nextcheckpoints_[i]->destroy(); 62 66 } 63 67 //nextcheckpoints_.destroy; … … 72 76 if(this->isVisible_){this->setRadarVisibility(true);} 73 77 else{this->setRadarVisibility(false);} 78 79 74 80 /*this->setRadarVisibility(false); 75 81 Vector3 v =Vector3(0,0,0); -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
r8944 r8949 46 46 RegisterObject(SpaceRace); 47 47 48 const std::string& message = "SpaceRace constructed"; 49 orxout()<< message << endl; 48 50 49 51 50 this->bTimeIsUp_ = false; 52 51 this->numberOfBots_ = 0; 53 52 this->cantMove_=false; 53 54 54 55 55 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) … … 97 97 98 98 void SpaceRace::start() 99 { 100 Gametype::start();101 this->spawnPlayersIfRequested(); //Gametype::checkStart();99 { 100 //Gametype::start(); 101 this->spawnPlayersIfRequested(); Gametype::checkStart(); 102 102 this->cantMove_=true; 103 103 … … 117 117 118 118 this->addBots(this->numberOfBots_); 119 119 120 120 } 121 121 … … 144 144 145 145 void SpaceRace::setV(SpaceRaceManager* m){ 146 Vector3 v =Vector3(0,0,0);146 /*Vector3 v =Vector3(0,0,0); 147 147 int j=0; 148 148 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) … … 152 152 v=r->getNextcheckpoint(); 153 153 for(int i=1;i<4;i++){ 154 RaceCheckPoint* n=m->getCheckpoint(i); 154 if(v[i]==0){ 155 RaceCheckPoint* n=m->getCheckpoint(v[i]); 155 156 n->setV(true); 156 } 157 } 157 }} 158 }*/ 158 159 } 159 160 … … 191 192 192 193 void SpaceRace::playerEntered(PlayerInfo* player){ 193 this->checkpointReached_[player]=0; 194 this->playersAlive_++; 194 Gametype::playerEntered(player); 195 //this->checkpointReached_[player]=0; 196 //this->playersAlive_++; 195 197 } 196 198 197 199 bool SpaceRace::playerLeft(PlayerInfo* player){ 198 bool valid_player = true; 199 if (valid_player) 200 { 201 this->playersAlive_--; 202 } 203 204 return valid_player; 200 return Gametype::playerLeft(player); 201 // bool valid_player = true; 202 //if (valid_player) 203 // { 204 // this->playersAlive_--; 205 //} 206 207 // return valid_player; 205 208 } 206 209 } -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
r8944 r8949 46 46 RegisterObject(SpaceRaceManager); 47 47 48 const std::string& message = "SpaceRaceManager constructed"; 49 orxout()<< message << endl; 48 50 49 } 51 50 -
code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc
r8944 r8949 134 134 135 135 } 136 137 const std::string& message = "Gametype should start"; 138 orxout()<< message << endl; 139 this->start(); 140 const std::string& message2 = "Gametype should have started"; 141 orxout()<< message2 << endl; 136 137 this->checkStart(); 138 142 139 143 140 } … … 149 146 150 147 void Gametype::start() 151 { const std::string& message = "Gametype starts"; 152 orxout()<< message << endl; 148 { 153 149 154 150 this->addBots(this->numberOfBots_); … … 158 154 this->spawnPlayersIfRequested(); 159 155 160 156 161 157 } 162 158 … … 387 383 { 388 384 this->gtinfo_->stopStartCountdown(); 389 this->gtinfo_->setStartCountdown(0.0f); ;385 this->gtinfo_->setStartCountdown(0.0f); 390 386 this->start(); 391 387 } … … 408 404 hashumanplayers = true; 409 405 } 406 410 407 if (allplayersready && hashumanplayers) 411 408 { … … 419 416 } 420 417 } 418 421 419 } 422 420 } -
code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc
r8944 r8949 164 164 { 165 165 if(this->bStarted_) 166 {const std::string& message = "bStarted true"; 167 orxout()<< message << endl; return;} 166 { return;} 168 167 169 168 this->bStarted_ = true; 170 169 this->changedStarted(); 171 170 172 const std::string& message = "bStarted true"; 173 orxout()<< message << endl; 171 174 172 } 175 173
Note: See TracChangeset
for help on using the changeset viewer.