Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8949


Ignore:
Timestamp:
Nov 23, 2011, 4:16:15 PM (12 years ago)
Author:
eceline
Message:

level Spacerace2 works now

Location:
code/branches/spaceraceTwo
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceraceTwo/data/levels/Spacerace2.oxw

    r8944 r8949  
    5353</SpaceRaceManager>
    5454
    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>
    5667
    5768
  • code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc

    r8940 r8949  
    3939{
    4040    CreateFactory(RaceCheckPoint);
     41   
     42     
    4143
    4244    RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
    4345    {
    4446        RegisterObject(RaceCheckPoint);
    45 
     47       
     48       
     49           
    4650        this->bCheckpointIndex_ = 0;
    4751        //this->bIsLast_ = false;
    4852        this->bTimeLimit_ = 0;
    49         this->isVisible_=false;
     53        this->isVisible_=true;
    5054
    5155        this->setRadarObjectColour(ColourValue::Blue);
    5256        this->setRadarObjectShape(RadarViewable::Triangle);
    53         this->setRadarVisibility(false);
     57        this->setRadarVisibility(true);
    5458    }
    5559
     
    5862         //if (this->isInitialized())
    5963        {
    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();
    6266        }
    6367       //nextcheckpoints_.destroy;
     
    7276        if(this->isVisible_){this->setRadarVisibility(true);}
    7377        else{this->setRadarVisibility(false);}
     78       
     79       
    7480        /*this->setRadarVisibility(false);
    7581        Vector3 v =Vector3(0,0,0);
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc

    r8944 r8949  
    4646        RegisterObject(SpaceRace);
    4747       
    48          const std::string& message = "SpaceRace constructed";
    49          orxout()<< message << endl;
     48       
    5049   
    5150        this->bTimeIsUp_ = false;
    5251        this->numberOfBots_ = 0;
    5352        this->cantMove_=false;
     53       
    5454       
    5555       for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     
    9797
    9898    void SpaceRace::start()
    99     { 
    100                 Gametype::start();
    101                            this->spawnPlayersIfRequested(); //Gametype::checkStart();
     99    {
     100                //Gametype::start();
     101                           this->spawnPlayersIfRequested(); Gametype::checkStart();
    102102                           this->cantMove_=true;
    103103         
     
    117117                               
    118118                               this->addBots(this->numberOfBots_);
    119        
     119     
    120120    }
    121121   
     
    144144
    145145        void SpaceRace::setV(SpaceRaceManager* m){
    146                 Vector3 v =Vector3(0,0,0);
     146                /*Vector3 v =Vector3(0,0,0);
    147147        int j=0;
    148148        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     
    152152                v=r->getNextcheckpoint();
    153153                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]);
    155156                 n->setV(true);
    156                  }
    157         }
     157                 }}
     158        }*/
    158159        }
    159160
     
    191192
    192193void SpaceRace::playerEntered(PlayerInfo* player){
    193         this->checkpointReached_[player]=0;
    194         this->playersAlive_++;
     194        Gametype::playerEntered(player);
     195        //this->checkpointReached_[player]=0;
     196        //this->playersAlive_++;
    195197    }
    196198   
    197199        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;
    205208        }
    206209}
  • code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc

    r8944 r8949  
    4646        RegisterObject(SpaceRaceManager);
    4747         
    48           const std::string& message = "SpaceRaceManager constructed";
    49          orxout()<< message << endl;     
     48         
    5049    }
    5150
  • code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc

    r8944 r8949  
    134134               
    135135            }
    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           
    142139         
    143140        }
     
    149146
    150147    void Gametype::start()
    151     { const std::string& message = "Gametype starts";
    152          orxout()<< message << endl;
     148    {
    153149         
    154150        this->addBots(this->numberOfBots_);
     
    158154        this->spawnPlayersIfRequested();
    159155       
    160          
     156       
    161157    }
    162158
     
    387383                {
    388384                    this->gtinfo_->stopStartCountdown();
    389                     this->gtinfo_->setStartCountdown(0.0f);;
     385                    this->gtinfo_->setStartCountdown(0.0f);
    390386                    this->start();
    391387                }
     
    408404                            hashumanplayers = true;
    409405                    }
     406                         
    410407                    if (allplayersready && hashumanplayers)
    411408                    {
     
    419416                }
    420417            }
     418           
    421419        }
    422420    }
  • code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc

    r8944 r8949  
    164164    {
    165165        if(this->bStarted_)
    166            {const std::string& message = "bStarted true";
    167          orxout()<< message << endl; return;}
     166           { return;}
    168167       
    169168        this->bStarted_ = true;
    170169        this->changedStarted();
    171170       
    172         const std::string& message = "bStarted true";
    173          orxout()<< message << endl;
     171       
    174172    }
    175173
Note: See TracChangeset for help on using the changeset viewer.