- Timestamp:
- May 16, 2019, 7:16:49 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12394 r12395 112 112 } 113 113 */ 114 115 for (OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()) { 116 if(stone != nullptr) 117 stone->destroy(); 118 } 119 120 114 121 for (OrxoBloxWall* wall : this->activeWalls_) { 115 122 if (wall != nullptr) … … 117 124 } 118 125 this->activeWalls_.clear(); 119 120 121 for (OrxoBloxStones* stone : this->stones_) { 122 if(stone != nullptr) 123 stone->destroy(); 124 } 126 125 127 this->stones_.clear(); 126 128 if(this->playership != nullptr) { … … 189 191 // Call end for the parent class. 190 192 Deathmatch::end(); 191 GSLevel::startMainMenu();193 //GSLevel::startMainMenu(); 192 194 } 193 195 … … 214 216 215 217 orxout() << "level up called" << endl; 216 //this->playerScored(this->player_);// add points218 this->playerScored(this->player_);// add points 217 219 218 220 this->createWall(); 219 221 this->activeWalls_.push_back(this->futureWall_); 220 /*for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {222 for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) { 221 223 this->stones_.push_back(this->futureWall_->getStone(i)); 222 } */224 } 223 225 224 226 for(OrxoBloxWall* wall : this->activeWalls_) { … … 244 246 //create balls 245 247 //insert new wall 246 for(OrxoBloxStones* stone : this->stones_){247 if (stone != nullptr) {248 for(OrxoBloxStones* stone : ObjectList<OrxoBloxStones>()){ 249 if (stone->isA(Class(OrxoBloxStones))) { 248 250 int x_=(stone->getPosition()).x; 249 251 int y_=(stone->getPosition()).y; … … 256 258 this->end(); 257 259 } 260 } 261 else { 262 stone = nullptr; 258 263 } 259 264 } … … 341 346 */ 342 347 void OrxoBlox::count() { 343 if( this->counter>= this->max_counter) {348 if(++(this->counter) >= this->max_counter) { 344 349 this->LevelUp(); 345 350 counter = 0; 346 351 return; 347 352 } 348 else {349 this->counter++;350 }351 353 } 352 354 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
r12394 r12395 111 111 std::vector<OrxoBloxStones*> stones_; //!< A list of all stones in play. 112 112 int counter; 113 const int max_counter = 10;113 const int max_counter = 4; 114 114 115 115 }; -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
r12393 r12395 61 61 } 62 62 63 this->num_Stones_ = TotalStones_.size();64 65 63 66 64 … … 97 95 98 96 int OrxoBloxWall::getNumberOfStones() { 99 return num_Stones_;97 return TotalStones_.size(); 100 98 } 101 99 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h
r12360 r12395 46 46 void reduceNumberOfStones(); 47 47 void setNumberOfStones(int number); 48 std::vector<OrxoBloxStones*> TotalStones_; 48 49 private: 49 50 void createWall(void); … … 51 52 unsigned int totalhealth_; 52 53 unsigned int num_Stones_; 53 unsigned int size_; 54 std::vector<OrxoBloxStones*> TotalStones_; //!< A list of all stones in a Wall. 54 unsigned int size_; //!< A list of all stones in a Wall. 55 55 bool delay_; 56 56 OrxoBlox* orxoblox_;
Note: See TracChangeset
for help on using the changeset viewer.