Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2011, 6:07:32 PM (12 years ago)
Author:
eceline
Message:

added waypoint patrol controller to level, RaceCheckPoint::fire works now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc

    r8959 r8968  
    2929#include "SpaceRace.h"
    3030
    31 //#include "SpaceRaceManager.h"
    3231
    3332#include "items/Engine.h"
     
    10099    void SpaceRace::start()
    101100    {
    102                 //Gametype::start();
    103                            this->spawnPlayersIfRequested(); Gametype::checkStart();
     101               
     102                           this->spawnPlayersIfRequested();
     103                           
     104                            Gametype::checkStart();
    104105                           this->cantMove_=true;
    105106         
     
    142143     
    143144    }
    144     // for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    145       //  {if(this->getCheckpointReached(it->first)==-1) orxout()<<"index -1"<<endl;}
     145   
    146146   
    147147    }
    148148
    149         void SpaceRace::setV(SpaceRaceManager* m){/*
    150                 Vector3 v =Vector3(0,0,0);
    151         int j=0;
    152         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    153         {
    154                 j=this->getCheckpointReached(it->first);
    155                 RaceCheckPoint* r=m->getCheckpoint(j);
    156                 v=r->getNextcheckpoint();
    157                 for(int i=1;i<4;i++){
    158                 if(v[i]==0){
    159                  RaceCheckPoint* n=m->getCheckpoint(v[i]);
    160                  n->setV(true);
    161                  }}
    162         }*/
    163         }
    164 
     149       
     150   
    165151    void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
    166     {/*
    167         this->checkpointReached_[pl]=index;
     152            {
     153                this->checkpointReached_[pl]=index;
    168154        this->clock_.capture();
    169         int s = this->clock_.getSeconds();
     155                int s = this->clock_.getSeconds();
    170156        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
    171         const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
     157                const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
    172158                        + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
    173                         + " seconds.";
     159                                + " seconds.";
    174160        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    175161        ChatManager::message(message);
    176        */
    177        
    178     }
    179    
     162                       
     163            }
     164   
    180165     void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl)
    181     {   int index = p->getCheckpointIndex();
    182         this->checkpointReached_[pl]=index;
    183         this->clock_.capture();
    184         int s = this->clock_.getSeconds();
    185         int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
     166            {   int index = p->getCheckpointIndex();
     167                this->checkpointReached_[pl]=index;
     168                this->clock_.capture();
     169                int s = this->clock_.getSeconds();
     170                int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
    186171        const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
    187                         + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
     172                                + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
    188173                        + " seconds.";
    189         const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
    190         ChatManager::message(message);
    191        
    192        
    193     }
     174                const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
     175                ChatManager::message(message);
     176               
     177               
     178            }
     179           
    194180   
    195181   
     
    212198       // return valid_player;
    213199        }
     200       
     201         bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
     202    {
     203        return false;
     204    }
     205
     206    bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator)
     207    {
     208        return false;
     209    }
     210
     211    bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
     212    {
     213        return false;
     214    }
    214215}
Note: See TracChangeset for help on using the changeset viewer.