- Timestamp:
- Nov 16, 2011, 4:20:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
r8934 r8940 45 45 { 46 46 RegisterObject(SpaceRace); 47 this->checkpointReached_ = 0;47 48 48 this->bTimeIsUp_ = false; 49 49 this->numberOfBots_ = 0; 50 50 this->cantMove_=false; 51 51 52 52 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 53 {this->checkpointReached_[it->first]=0;} 53 54 } 54 55 … … 136 137 } 137 138 138 139 140 141 void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index) 142 { 143 this->checkpointReached_=index; 139 void SpaceRace::setV(SpaceRaceManager* m){ 140 Vector3 v =Vector3(0,0,0); 141 int j=0; 142 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 143 { 144 j=this->getCheckpointReached(it->first); 145 RaceCheckPoint* r=m->getCheckpoint(j); 146 v=r->getNextcheckpoint(); 147 for(int i=1;i<4;i++){ 148 RaceCheckPoint* n=m->getCheckpoint(i); 149 n->setV(true); 150 } 151 } 152 } 153 154 void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl) 155 { 156 this->checkpointReached_[pl]=index; 144 157 this->clock_.capture(); 145 158 int s = this->clock_.getSeconds(); … … 154 167 } 155 168 156 void SpaceRace::newCheckpointReached(RaceCheckPoint* p )169 void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl) 157 170 { int index = p->getCheckpointIndex(); 158 this->checkpointReached_ =index;171 this->checkpointReached_[pl]=index; 159 172 this->clock_.capture(); 160 173 int s = this->clock_.getSeconds(); … … 169 182 } 170 183 171 int SpaceRace::getCheckpointReached(PlayerInfo* player){ 172 return this->currentCheckpoint_[player]; 173 } 184 174 185 175 186 void SpaceRace::playerEntered(PlayerInfo* player){ 176 this->c urrentCheckpoint_[player]=1;187 this->checkpointReached_[player]=0; 177 188 this->playersAlive_++; 178 189 }
Note: See TracChangeset
for help on using the changeset viewer.