Changeset 11246 for code/branches/SpaceRace_HS16/src/modules
- Timestamp:
- Oct 24, 2016, 4:06:00 PM (8 years ago)
- Location:
- code/branches/SpaceRace_HS16/src/modules/gametypes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
Note: See TracChangeset
for help on using the changeset viewer.