- Timestamp:
- May 11, 2017, 3:18:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
r11412 r11416 21 21 * 22 22 * Author: 23 * Fabian 'x3n' Landau23 * Julien Kindle 24 24 * Co-authors: 25 * ...25 * 26 26 * 27 27 */ 28 28 29 29 /** 30 @file Pong.cc31 @brief Implementation of the Pongclass.30 @file SOB.cc 31 @brief Implementation of the SOB class. 32 32 */ 33 33 34 34 #include "SOB.h" 35 36 35 #include "core/CoreIncludes.h" 37 36 #include "core/EventIncludes.h" … … 39 38 #include "core/config/ConfigValueIncludes.h" 40 39 #include "core/Game.h" 41 42 40 #include "gamestates/GSLevel.h" 43 41 #include "chat/ChatManager.h" 44 42 #include "infos/PlayerInfo.h" 45 46 43 #include "SOBCenterpoint.h" 47 48 44 #include "SOBFigure.h" 49 45 #include "graphics/Camera.h" 46 47 50 48 51 49 namespace orxonox … … 89 87 } 90 88 89 90 91 91 void SOB::start() 92 92 { … … 95 95 if (figure_ == nullptr) 96 96 { 97 figure_ = new SOBFigure(center_->getContext()); 97 figure_ = new SOBFigure(center_->getContext()); //add a new instance of a player to the game 98 98 figure_->addTemplate(center_->getFigureTemplate()); 99 // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@100 99 } 101 100 … … 124 123 cleanup(); 125 124 GSLevel::startMainMenu(); 126 127 125 Deathmatch::end(); 128 126 } … … 131 129 cleanup(); 132 130 133 // HACK 131 // HACK - only method I found to simply reload the level 134 132 Game::getInstance().popState(); 135 133 Game::getInstance().popState(); … … 144 142 if (figure_->getPlayer() == nullptr) 145 143 { 146 player->startControl(figure_); 144 player->startControl(figure_); //Give the control of the instance player to the real person 147 145 players_[player].state_ = PlayerState::Alive; 148 146 } … … 165 163 SUPER(SOB, tick, dt); 166 164 167 if (this->figure_ != nullptr && figure_->dead_) { 165 //If player has reached end of level 166 if (this->figure_ != nullptr && figure_->lvlEnded_) { 167 std::stringstream a; 168 a << "Nice! " << getPoints() << " Points. Press <Space> to restart"; 169 info_ =a.str(); 170 171 //If player has died 172 } else if (this->figure_ != nullptr && figure_->dead_) { 168 173 info_ = "Game over. Press <Space> to restart"; 169 orxout() << "DEED" << endl;170 174 } 171 175 172 176 177 //Kill the player if time is up 178 if (this->figure_ != nullptr && timeLeft_ <= 0) 179 this->figure_->dead_ = true; 180 //The time on the HUD 173 181 timeLeft_-=dt*2.5; 174 182 }
Note: See TracChangeset
for help on using the changeset viewer.