Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11986 for code/branches


Ignore:
Timestamp:
May 24, 2018, 3:03:31 PM (7 years ago)
Author:
arismu
Message:

messages

Location:
code/branches/RacingBots_FS18/src/modules/gametypes
Files:
4 edited

Legend:

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

    r11982 r11986  
    142142        }
    143143
    144         std::string message("Use headphones to hear the countdown! Press W for forward acceleration, W+space bar for boost!");
     144        std::string message("Use headphones to hear the countdown! Press W for forward acceleration, press W+space for boost!");
    145145
    146146        this->getGametypeInfo()->sendAnnounceMessage(message);
     
    191191        int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s);
    192192        std::string message;
    193         message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
    194 
    195193        if (this->bTimeIsUp_)
    196194        {
     
    198196                        + "You loose!";
    199197        }
     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
     201       }       
    200202       
    201203        else
     
    207209        if (!this->hasEnded())
    208210        {
     211
    209212            this->getGametypeInfo()->sendAnnounceMessage(message);
    210213            ChatManager::message(message);
     
    222225
    223226       
    224    
    225         const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
     227        std::string message(player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
     228        + " after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.");
     229
     230        this->getGametypeInfo()->sendAnnounceMessage(message);
     231        ChatManager::message(message);
     232      /*  const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
    226233        + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
    227234        this->getGametypeInfo()->sendAnnounceMessage(message);
    228         ChatManager::message(message);
    229         if(checkpoint->getCheckpointIndex()==20){
     235        ChatManager::message(message);*/
     236        if(checkpoint->getCheckpointIndex()==19){
    230237             const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
    231238                + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds and WON THE GAME.";
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h

    r11967 r11986  
    4141
    4242#include "SpaceRaceManager.h"
     43
    4344
    4445namespace orxonox
     
    8889            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override;
    8990            bool countdown_mode = false;
    90             float time_passed = 4.0f;
     91            float time_passed = 11.0f;
    9192           
    9293            bool bLost=false;
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc

    r11982 r11986  
    107107        return returnVec;
    108108    }
    109     /*void SpaceRaceController::endtheGame() const {
     109    void SpaceRaceController::endtheGame() const {
    110110        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
    111         assert(gametype);
    112         if (!gametype)
     111        assert(gametype)
     112;        if (!gametype)
    113113        return;
     114        gametype->bLost=true;
    114115        gametype->end();
    115116
    116     }*/
     117    }
    117118    /*
    118119     * called from 'findStaticCheckpoints'
     
    176177        {
    177178            RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex);
     179
    178180            float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
    179181
     
    184186
    185187            }
    186 
    187         }
    188         if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @181 SpaceRaceController" << endl;}
     188            //There is a bug. If the user passes through the 19th checkpoint with the opponents, the game will end immediately
     189            if(nextRaceCheckPoint->isLast())
     190                endtheGame();
     191
     192        }
     193        if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @192 SpaceRaceController" << endl;}
    189194        return minNextRaceCheckPoint;
    190195    }
  • code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h

    r11982 r11986  
    5858            RaceCheckPoint* nextPointFind(RaceCheckPoint*);
    5959            RaceCheckPoint* adjustNextPoint();
    60             //void endtheGame() const;
     60            void endtheGame() const;
    6161
    6262            std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&);
Note: See TracChangeset for help on using the changeset viewer.