Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11977


Ignore:
Timestamp:
May 17, 2018, 4:24:48 PM (7 years ago)
Author:
arismu
Message:

updated endthe
Game

Location:
code/branches/RacingBots_FS18
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw

    r11938 r11977  
    214214  </StaticEntity>
    215215
    216 <StaticEntity position="10000,-70,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static">
     216<StaticEntity position="11000,-60,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static">
    217217    <attached>
    218218      <Model scale="20" mesh="Board2.mesh" />
     
    498498      </attached>
    499499      <controller>
    500         <ArrowController accuracy = 5000>
     500        <ArrowController accuracy = 10000>
    501501          <gpspoints>
    502502            <Model mesh="cube.mesh" scale=0 position="1000,30,0"/>
    503503            <Model mesh="cube.mesh" scale=0 position="3000,200,100"/>
    504             <Model mesh="cube.mesh" scale=0 position="5000,100,500"/>
     504            <Model mesh="cube.mesh" scale=0 position="5000,80,500"/>
    505505            <Model mesh="cube.mesh" scale=0 position="8000,-150,150"/>
    506             <Model mesh="cube.mesh" scale=0 position="10000,-200,200"/>
    507             <Model mesh="cube.mesh" scale=0 position="13000,200,400"/>
    508             <Model mesh="cube.mesh" scale=0 position="15000,0,0"/>
     506            <Model mesh="cube.mesh" scale=0 position="11000,-200,200"/>
     507            <Model mesh="cube.mesh" scale=0 position="13000,-70,350"/>
     508            <Model mesh="cube.mesh" scale=0 position="15500,0,0"/>
    509509            <Model mesh="cube.mesh" scale=0 position="18000,150,-150"/>
    510510            <Model mesh="cube.mesh" scale=0 position="21000,200,-120"/>
    511511            <Model mesh="cube.mesh" scale=0 position="24000,-150,-80"/>
    512512            <Model mesh="cube.mesh" scale=0 position="27000,-200,0"/>
    513             <Model mesh="cube.mesh" scale=0 position="30000,-300,900"/>
    514             <Model mesh="cube.mesh" scale=0 position="33000,600,60"/>
    515             <Model mesh="cube.mesh" scale=0 position="35000,120,20"/>
    516             <Model mesh="cube.mesh" scale=0 position="38000,-200,0"/>
     513            <Model mesh="cube.mesh" scale=0 position="30000,-250,670"/>
     514            <Model mesh="cube.mesh" scale=0 position="33000,150,600"/>
     515            <Model mesh="cube.mesh" scale=0 position="35000,500,300"/>
     516            <Model mesh="cube.mesh" scale=0 position="38000,150,150"/>
    517517            <Model mesh="cube.mesh" scale=0 position="41000,30,-50"/>
    518518            <Model mesh="cube.mesh" scale=0 position="44000,90,0"/>
    519519            <Model mesh="cube.mesh" scale=0 position="47000,120,30"/>
    520520            <Model mesh="cube.mesh" scale=0 position="50000,0,100"/>
    521             <Model mesh="cube.mesh" scale=0 position="51000,0,0"/>
     521            <Model mesh="cube.mesh" scale=0 position="53000,0,0"/>
    522522
    523523           
     524
     525
     526           
    524527
    525528                </gpspoints>
  • code/branches/RacingBots_FS18/data/levels/templates/fastship.oxt

    r11938 r11977  
    2525
    2626
    27    boostPower            = 8 
     27   boostPower            = 7.5 
    2828   boostPowerRate        = 3
    29    boostRate             =
     29   boostRate             = 7.5
    3030   boostCooldownDuration = 6
    3131
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc

    r11966 r11977  
    125125        {
    126126            engine->setActive(false);
    127             engine->setAccelerationFront(100.0f);
     127            engine->addSpeedMultiply(1.7);
    128128        }
    129129
     
    186186    void SpaceRace::end()
    187187    {
     188       
    188189        this->clock_.capture();
    189190        int s = this->clock_.getSeconds();
    190191        int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s);
    191192        std::string message;
     193        message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
    192194
    193195        if (this->bTimeIsUp_)
     
    196198                        + "You loose!";
    197199        }
    198         else if(this->bLost)
    199             message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
     200       
    200201        else
    201202        {
     
    203204                        + "." + multi_cast<std::string>(ms) + " seconds.";
    204205        }
     206       
    205207        if (!this->hasEnded())
    206208        {
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc

    r11965 r11977  
    107107        return returnVec;
    108108    }
    109 
     109    void SpaceRaceController::endtheGame() const {
     110        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
     111        assert(gametype);
     112        if (!gametype)
     113        return;
     114        gametype->end();
     115
     116    }
    110117    /*
    111118     * called from 'findStaticCheckpoints'
     
    179186
    180187        }
    181         if(minNextRaceCheckPoint == nullptr) orxout()<<"nullptr found @181 SpaceRaceController" << endl;
     188        if(minNextRaceCheckPoint == nullptr) {endtheGame(); orxout()<<"nullptr found @181 SpaceRaceController" << endl;}
    182189        return minNextRaceCheckPoint;
    183190    }
     
    233240    }
    234241
     242
     243
     244
     245   
     246
    235247    RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
    236248    {
     249        RaceCheckPoint* res = nullptr;
    237250        for (RaceCheckPoint* checkpoint : this->checkpoints_){
    238251            //conclusion: index=20 is not
    239252            if (checkpoint->getCheckpointIndex() == index){
    240                 if(checkpoint == nullptr) orxout()<<"returned nullptr @line 234 SpaceRaceController"<<endl;
    241                 return checkpoint;
    242             }
    243         }
    244 
    245         return nullptr;
    246     }
     253                //if(checkpoint == nullptr) orxout()<<"returned nullptr @line 234 SpaceRaceController"<<endl;
     254                orxout()<< "index of the checkpoint "<< index <<endl;
     255                res = checkpoint;
     256                return res;
     257            }
     258        }
     259     if(index>2 )   
     260        this->endtheGame();
     261
     262        return res;
     263    }
     264   
     265
    247266
    248267    /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , const Vector3& virtualCheckPointPosition )
     
    299318    void SpaceRaceController::tick(float dt)
    300319    {
     320       
     321
    301322        if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr )
    302323        {
     
    361382        // }
    362383
     384       
    363385        this->moveToPosition(nextRaceCheckpoint_->getPosition());
    364386
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h

    r11964 r11977  
    5858            RaceCheckPoint* nextPointFind(RaceCheckPoint*);
    5959            RaceCheckPoint* adjustNextPoint();
     60            void endtheGame() const;
     61
    6062            std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&);
    6163            std::vector<RaceCheckPoint*> staticCheckpoints();
Note: See TracChangeset for help on using the changeset viewer.