Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 24, 2016, 4:06:00 PM (8 years ago)
Author:
bberabi
Message:

sound and countdown erledigt, flugzeuge konnen nicht mehr sich bewegen bevor countdown ends

Location:
code/branches/SpaceRace_HS16/src
Files:
7 edited

Legend:

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

    r11239 r11246  
    3333#include "util/Convert.h"
    3434#include "util/Math.h"
     35#include "SpaceRaceBot.h"
     36#include "items/Engine.h"
     37#include "controllers/HumanController.h"
     38
     39
    3540
    3641namespace orxonox
     
    4348        this->checkpointsReached_ = 0;
    4449        this->bTimeIsUp_ = false;
    45         this->numberOfBots_ = 0;
     50        this->numberOfBots_ = 1;
    4651    }
    4752
     
    8489        Gametype::start();
    8590
    86         std::string message("Take Them All!");
     91   if (true)
     92        {
     93            this->spawnPlayersIfRequested();
     94            this->cantMove_ = true;
     95
     96            for (Engine* engine : ObjectList<Engine>()){
     97                engine->setActive(false);
     98               
     99
     100            }
     101           
     102        }
     103
     104       
     105
     106        std::string message("BE FAST BE FIRST");
    87107        this->getGametypeInfo()->sendAnnounceMessage(message);
    88108        ChatManager::message(message);
     109
     110Timer* countdownTimer = new Timer();
     111        countdownTimer->setTimer(11, false, createExecutor(createFunctor(&OldSpaceRace::countdownFinished, this)));
    89112    }
    90113
     114    void OldSpaceRace::countdownFinished()
     115    {
     116
     117        std::string message("RACE STARTED ");
     118        this->getGametypeInfo()->sendAnnounceMessage(message);
     119        ChatManager::message(message);
     120
     121
     122    for (Engine* engine : ObjectList<Engine>())
     123                engine->setActive(true);
     124   
     125
     126
     127    }
     128 
    91129    void OldSpaceRace::newCheckpointReached()
    92130    {
  • code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.h

    r11071 r11246  
    5656
    5757            virtual void start() override;
     58
    5859            virtual void end() override;
     60
    5961
    6062            virtual void newCheckpointReached();
    6163            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command.
    62                                                         //<! This is only a temporary solution. Better: create racingBots.
     64            virtual  void countdownFinished();
     65                                          //<! This is only a temporary solution. Better: create racingBots.
    6366
    6467            inline void setCheckpointsReached(int n)
     
    7275
    7376        private:
     77            bool cantMove_;                                            ///< Helper variable, used to stall the engines before the race starts.
    7478            int checkpointsReached_; //The current number of check points reached by the player.
    7579            std::set<float> scores_; //The times of the players are saved in a set.
  • code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc

    r11232 r11246  
    4949        this->cantMove_ = false;
    5050        this->bTimeIsUp_ = false;
    51         this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race
     51        this->numberOfBots_ = 1; // quick fix: don't allow default-bots to enter the race
    5252                                 // remove this line, if a raceBot has been created.
    5353    }
     54
     55
     56
     57
     58
     59
    5460
    5561    void SpaceRace::end()
     
    7884    }
    7985
     86   
     87
     88
     89
     90
    8091    void SpaceRace::tick(float dt)
    8192    {
     
    100111            this->cantMove_= false;
    101112
    102             std::string message = "The race begins! Reach the check points as quickly as possible!";
     113
     114
     115            std::string message = "Hello!";
    103116            this->getGametypeInfo()->sendAnnounceMessage(message);
    104117            ChatManager::message(message);
    105118        }
    106119    }
     120
     121
     122
     123
     124
    107125
    108126    void SpaceRace::newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player)
  • code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.h

    r11071 r11246  
    5757            virtual ~SpaceRace() {}
    5858
     59
    5960            virtual void tick(float dt) override;
    6061
  • code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceController.cc

    r11099 r11246  
    1616 *   GNU General Public License for more details.
    1717 *
    18  *   You should have received a copy of the GNU General Public License
     18 *   You should have     a copy of the GNU General Public License
    1919 *   along with this program; if not, write to the Free Software
    2020 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  • code/branches/SpaceRace_HS16/src/orxonox/controllers/HumanController.h

    r11071 r11246  
    9393            //friend class, for mouselook
    9494            friend class Map;
     95            static HumanController* localController_s;
    9596
    9697        protected:
    97             static HumanController* localController_s;
    9898            bool controlPaused_;
    9999
  • code/branches/SpaceRace_HS16/src/orxonox/sound/WorldAmbientSound.cc

    r11071 r11246  
    5858        soundList_.emplace_back("Ganymede.ogg");
    5959        soundList_.emplace_back("luke_grey_-_hypermode.ogg");
     60        soundList_.emplace_back("racetheme.ogg");
     61
    6062
    6163    }
Note: See TracChangeset for help on using the changeset viewer.