Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2016, 5:46:18 PM (8 years ago)
Author:
bberabi
Message:

all the other unnessary spacerace files are deleted, oldracecheckpoint is deleted, there is already a racecheckpoint class, comments are added, everything seems okay

Location:
code/branches/SpaceRace_HS16/src/modules/gametypes
Files:
4 deleted
1 edited

Legend:

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

    r11334 r11337  
    2323 *     Mauro Salomon
    2424 *   Co-authors:
    25  *      Celine Egger
     25 *      Celine Egger*/
     26       
     27
     28
     29
     30/*
     31Edited, Renewed and Revised by
    2632        Berkay Berabi
    2733        Louis Meile
    28  *
    29  */
    30 
    31 /*
    32 Todo:
     34 
     35 
     36To-do- list by Louis Meile and Berkay Berabi for future projects :
    3337- improve AI (SpaceRaceController):
    3438i) so far bots arent able to evade obstacles. fix that!
    3539ii) bots should be able to use pickups
    36 - game crashes when bot wins the game
     40- game crashes when bot wins the game(this is a huge problem you should work with the log file to find out what the errors are )
    3741- bots rotate while waiting for the countdown to end. make it stop!
    3842- add elements to level file to make it even more fun to play. be creative!
     
    8185        this->setConfigValues();
    8286
    83         this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race
     87        this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race
     88        //we fixed the number of bots in order to have the same starting position all the time !
    8489    }
    8590
     
    9095    }
    9196
     97    void SpaceRace::start()
     98    {
    9299    // define spawn positions of the 5 bots
    93     void SpaceRace::start()
    94     {
    95100
    96101        int startpos[15];
     
    124129            this->spawnPlayersIfRequested();
    125130            this->cantMove_ = true;
    126             //bots unable to move while countdown is running
     131            //players are unable to move while countdown is running
    127132            for (Engine* engine : ObjectList<Engine>()){
    128133                engine->setActive(false);
     
    151156        ChatManager::message(message);
    152157
    153 //after 11 s, countdownFinished is called to activate bots` engines
     158//after 11 seconds , countdownFinished function is called to activate bots` engines
    154159Timer* countdownTimer = new Timer();
    155160        countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));
     
    207212    }
    208213
    209  void SpaceRace::countdownFinished()
     214 void SpaceRace::countdownFinished()//activates the engines of all players
    210215    {
    211216
     
    231236
    232237
    233  void SpaceRace::addBots(unsigned int amount)
     238 void SpaceRace::addBots(unsigned int amount) //function that add the bots to the game
    234239    {
    235240        for (unsigned int i = 1; i <= amount; ++i){
     
    250255    }
    251256
    252     bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
     257    bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)// false because the bots can not recognize the objects and die to early
     258                                                                    //if they can
    253259    {
    254260        return false;
Note: See TracChangeset for help on using the changeset viewer.