Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11246


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
Files:
10 edited

Legend:

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

    r10624 r11246  
    2424 name         = "Spacerace2"
    2525 description  = "Just a few tests"
    26  plugins = gametypes
    27  gametype = SpaceRace
     26 plugins = "gametypes"
     27 gametype = "SpaceRace"
    2828>
    2929  <templates>
  • code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw

    r11239 r11246  
    3232 
    3333  <!-- SOUNDS & MUSIC -->
    34   <!--  <WorldSound name="scoreSound" position="0,-2100,0" source="sounds/ReadyGo.ogg" >
    35       <events>
    36         <play>
    37           <EventListener event="start" />
    38         </play>
    39       </events>
    40     </WorldSound> -->
    4134 
    42 <WorldSound name="Countdown" position="0,-2100,0" source="sounds/Countdown.ogg" >
     35 
     36<WorldSound name="Countdown" position="0,0,0" source="sounds/Countdown.ogg" >
    4337      <events>
    4438        <play>
     
    4943
    5044
    51 <WorldSound name="Go" position="0,-2100,0" source="sounds/Go.ogg" >
     45<WorldSound name="Go" position="0,0,0" source="sounds/Go.ogg" >
    5246      <events>
    5347        <play>
     
    5751    </WorldSound>
    5852
    59 <WorldSound name="racetheme" position="0,-2100,0" source="sounds/racetheme.ogg" >
    60       <events>
     53
     54    <DistanceTrigger name="start1" position="0,0,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
     55    <DistanceTrigger name="go" position="0,0,0"  target="Pawn" distance=100 stayActive="true" delay=10.5  />
     56
     57    <DistanceTrigger name="racetheme" position="0,0,0"  target="Pawn" distance=100 stayActive="true" delay=10.75  />
     58
     59
     60
     61     
     62      <WorldAmbientSound source="racetheme.ogg" looping="true" playOnLoad="false" >
     63    <events>
    6164        <play>
    6265          <EventListener event="racetheme" />
    6366        </play>
    6467      </events>
    65     </WorldSound>
    66 
    67     <DistanceTrigger name="start1" position="0,-2100,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
    68         <DistanceTrigger name="go" position="0,-2100,0"  target="Pawn" distance=100 stayActive="true" delay=10.5  />
    69          <DistanceTrigger name="racetheme" position="0,-2100,0"  target="Pawn" distance=100 stayActive="true" delay=10.7  />
     68    </WorldAmbientSound>
    7069
    7170
    7271
    7372
    74       <WorldAmbientSound source="racetheme.ogg" looping="true" playOnLoad="true" />
     73
     74       
     75
    7576
    7677  <!--   <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" /> -->
  • code/branches/SpaceRace_HS16/data/levels/spaceRace.oxw

    r11239 r11246  
    5353    <DistanceTrigger name="start" position="0,-2100,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
    5454 
    55     <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
    5655 
    5756
  • 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.