Changeset 11246 for code/branches/SpaceRace_HS16
- Timestamp:
- Oct 24, 2016, 4:06:00 PM (8 years ago)
- Location:
- code/branches/SpaceRace_HS16
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SpaceRace_HS16/data/levels/Spacerace2.oxw
r10624 r11246 24 24 name = "Spacerace2" 25 25 description = "Just a few tests" 26 plugins = gametypes27 gametype = SpaceRace26 plugins = "gametypes" 27 gametype = "SpaceRace" 28 28 > 29 29 <templates> -
code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw
r11239 r11246 32 32 33 33 <!-- 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> -->41 34 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" > 43 37 <events> 44 38 <play> … … 49 43 50 44 51 <WorldSound name="Go" position="0, -2100,0" source="sounds/Go.ogg" >45 <WorldSound name="Go" position="0,0,0" source="sounds/Go.ogg" > 52 46 <events> 53 47 <play> … … 57 51 </WorldSound> 58 52 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> 61 64 <play> 62 65 <EventListener event="racetheme" /> 63 66 </play> 64 67 </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> 70 69 71 70 72 71 73 72 74 <WorldAmbientSound source="racetheme.ogg" looping="true" playOnLoad="true" /> 73 74 75 75 76 76 77 <!-- <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" /> --> -
code/branches/SpaceRace_HS16/data/levels/spaceRace.oxw
r11239 r11246 53 53 <DistanceTrigger name="start" position="0,-2100,0" target="Pawn" distance=100 stayActive="true" delay=0.5 /> 54 54 55 <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />56 55 57 56 -
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.cc
r11239 r11246 33 33 #include "util/Convert.h" 34 34 #include "util/Math.h" 35 #include "SpaceRaceBot.h" 36 #include "items/Engine.h" 37 #include "controllers/HumanController.h" 38 39 35 40 36 41 namespace orxonox … … 43 48 this->checkpointsReached_ = 0; 44 49 this->bTimeIsUp_ = false; 45 this->numberOfBots_ = 0;50 this->numberOfBots_ = 1; 46 51 } 47 52 … … 84 89 Gametype::start(); 85 90 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"); 87 107 this->getGametypeInfo()->sendAnnounceMessage(message); 88 108 ChatManager::message(message); 109 110 Timer* countdownTimer = new Timer(); 111 countdownTimer->setTimer(11, false, createExecutor(createFunctor(&OldSpaceRace::countdownFinished, this))); 89 112 } 90 113 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 91 129 void OldSpaceRace::newCheckpointReached() 92 130 { -
code/branches/SpaceRace_HS16/src/modules/gametypes/OldSpaceRace.h
r11071 r11246 56 56 57 57 virtual void start() override; 58 58 59 virtual void end() override; 60 59 61 60 62 virtual void newCheckpointReached(); 61 63 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. 63 66 64 67 inline void setCheckpointsReached(int n) … … 72 75 73 76 private: 77 bool cantMove_; ///< Helper variable, used to stall the engines before the race starts. 74 78 int checkpointsReached_; //The current number of check points reached by the player. 75 79 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 49 49 this->cantMove_ = false; 50 50 this->bTimeIsUp_ = false; 51 this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race51 this->numberOfBots_ = 1; // quick fix: don't allow default-bots to enter the race 52 52 // remove this line, if a raceBot has been created. 53 53 } 54 55 56 57 58 59 54 60 55 61 void SpaceRace::end() … … 78 84 } 79 85 86 87 88 89 90 80 91 void SpaceRace::tick(float dt) 81 92 { … … 100 111 this->cantMove_= false; 101 112 102 std::string message = "The race begins! Reach the check points as quickly as possible!"; 113 114 115 std::string message = "Hello!"; 103 116 this->getGametypeInfo()->sendAnnounceMessage(message); 104 117 ChatManager::message(message); 105 118 } 106 119 } 120 121 122 123 124 107 125 108 126 void SpaceRace::newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player) -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.h
r11071 r11246 57 57 virtual ~SpaceRace() {} 58 58 59 59 60 virtual void tick(float dt) override; 60 61 -
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceController.cc
r11099 r11246 16 16 * GNU General Public License for more details. 17 17 * 18 * You should have receiveda copy of the GNU General Public License18 * You should have a copy of the GNU General Public License 19 19 * along with this program; if not, write to the Free Software 20 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -
code/branches/SpaceRace_HS16/src/orxonox/controllers/HumanController.h
r11071 r11246 93 93 //friend class, for mouselook 94 94 friend class Map; 95 static HumanController* localController_s; 95 96 96 97 protected: 97 static HumanController* localController_s;98 98 bool controlPaused_; 99 99 -
code/branches/SpaceRace_HS16/src/orxonox/sound/WorldAmbientSound.cc
r11071 r11246 58 58 soundList_.emplace_back("Ganymede.ogg"); 59 59 soundList_.emplace_back("luke_grey_-_hypermode.ogg"); 60 soundList_.emplace_back("racetheme.ogg"); 61 60 62 61 63 }
Note: See TracChangeset
for help on using the changeset viewer.