Changeset 8949 for code/branches/spaceraceTwo/src/modules
- Timestamp:
- Nov 23, 2011, 4:16:15 PM (13 years ago)
- Location:
- code/branches/spaceraceTwo/src/modules/gametypes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.