Changeset 12331 for code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Timestamp:
- May 2, 2019, 3:30:57 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12329 r12331 49 49 #include "OrxoBloxCenterpoint.h" 50 50 #include "OrxoBloxBall.h" 51 #include "OrxoBloxBot.h"//Remove??51 //#include "OrxoBloxBot.h"//Remove?? 52 52 #include "OrxoBloxStones.h" 53 53 #include "OrxoBloxWall.h" … … 72 72 this->futureWall_ = nullptr; 73 73 this->player_ = nullptr; 74 74 level_ = 0; 75 75 76 76 this->setHUDTemplate("OrxoBloxHUD"); … … 149 149 this->ball_->setBatLength(this->center_->getBatLength()); 150 150 151 level_=1; 151 152 152 153 // Create the first Wall. … … 213 214 //void startWall(void); 214 215 215 216 void OrxoBlox::LevelUp(){ 217 level_++; 218 //When levelup? wo wird es ausgeloest? 219 //new location of ship 220 //new amount of balls 221 //create balls 222 //insert new wall 223 } 216 224 217 225 void OrxoBlox::createWall(void){ -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
r12314 r12331 76 76 OrxoBloxShip* getPlayer(); 77 77 78 void LevelUp(); 79 78 80 /** 79 81 @brief Set the OrxoBloxCenterpoint (the playing field). … … 97 99 98 100 PlayerInfo* player_; 101 unsigned int level_; 99 102 100 103 Timer starttimer_; //!< A timer to delay the start of the game. -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12310 r12331 144 144 // And its position is set as to not overstep the boundary it has just crossed. 145 145 if (position.z > this->fieldHeight_ / 2) 146 position.z = this->fieldHeight_ / 2;146 ChatManager::message("Ball hat das Feld verlassen.Jerome"); 147 147 if (position.z < -this->fieldHeight_ / 2) 148 148 position.z = -this->fieldHeight_ / 2; -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
r12310 r12331 123 123 124 124 125 void applyBats(); //!< Get the bats over the network. 125 126 126 127 127 static const float MAX_REL_Z_VELOCITY; -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h
r12314 r12331 70 70 class OrxoBlox; 71 71 class OrxoBloxBall; 72 73 72 class OrxoBloxCenterpoint; 74 73 class OrxoBloxWall; 75 class Orxo bloxStones;74 class OrxoBloxStones; 76 75 class OrxoBloxShip; 77 76 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.cc
r12307 r12331 18 18 19 19 this->size_ = 10.0f; 20 this->health_ = 1 0;20 this->health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7; 21 21 this->delay_ = false; 22 22 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h
r12307 r12331 1 1 #ifndef _OrxoBloxStones_H__ 2 2 #define _OrxoBloxStones_H__ 3 4 5 #include "OrxoBlox/OrxoBloxPrereqs.h" 3 6 4 7 … … 24 27 //} 25 28 29 /** 30 @brief Set the size of the stone. 31 @param size The dimensions a stone has in the game world. (A stone is a cube) 32 */ 33 void setSize(float size) 34 { this->size_ = size; } 35 /** 36 @brief Get the size of the stone. 37 @return Returns the dimensions a stone has in the game world. (A stone is a cube) 38 */ 39 float getSize(void) const 40 { return this->size_; } 26 41 /** 27 42 @brief Set the Health of the stone. -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
r12308 r12331 4 4 5 5 #include "OrxoBlox.h" 6 #include "OrxoBloxStones.h" 7 #include "OrxoBloxCenterpoint.h" 8 #include "util/Math.h" 6 9 7 10 namespace orxonox … … 16 19 RegisterObject(OrxoBloxWall); 17 20 18 this-> health_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7;21 this->num_Stones_ = 1 + static_cast<unsigned int>(rnd(6.0f)); //<! random number between 0 and 7; 19 22 this->delay_ = false; 20 23 this->orxoblox_ = this->getOrxoBlox(); 24 this->createWall(); 25 } 21 26 22 27 23 OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 24 if(this->orxoblox_ != nullptr) 28 void OrxoBloxWall::createWall(void){ 29 30 for (unsigned int i=0; i<this->num_Stones_;++i){ 31 OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 32 33 34 this->TotalStones_.push_back(stone); 35 this->attach(stone); 36 37 stone->setPosition(0.0f, i, 0.0f); 38 39 40 41 if(this->orxoblox_ != nullptr) 25 42 { 26 43 stone->setGame(this->orxoblox_); … … 32 49 else 33 50 orxout()<< "tetris_ == nullptr in TetrisBrick.cc"<< endl; 51 52 } 53 54 55 56 // OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 57 // if(this->orxoblox_ != nullptr) 58 // { 59 // stone->setGame(this->orxoblox_); 60 // if(this->orxoblox_->getCenterpoint() != nullptr) 61 // stone->addTemplate(this->orxoblox_->getCenterpoint()->getStoneTemplate()); 62 // else 63 // orxout()<< "orxoblox_->getCenterpoint == nullptr in TetrisBrick.cc"<< endl; 64 // } 65 // else 66 // orxout()<< "orxoblox_ == nullptr in TetrisBrick.cc"<< endl; 34 67 } 35 68 69 OrxoBloxStones* OrxoBloxWall::getStone(unsigned int i) 70 { 71 if(i < this->TotalStones_.size()) 72 return this->TotalStones_[i]; 73 else return nullptr; 74 } 36 75 37 76 OrxoBlox* OrxoBloxWall::getOrxoBlox() -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.h
r12307 r12331 2 2 #define _OrxoBloxWall_H__ 3 3 4 4 #include "OrxoBlox/OrxoBloxPrereqs.h" 5 5 #include "worldentities/StaticEntity.h" 6 6 #include "tools/Timer.h" … … 23 23 // this.destroy(); 24 24 //} 25 25 OrxoBloxStones* getStone(unsigned int i); 26 26 /** 27 27 @brief Set the Health of the stone. … … 30 30 void setHealth(unsigned int health) 31 31 { 32 this-> health_ = health;32 this->totalhealth_ = health; 33 33 } 34 34 35 /** 35 36 @brief Get the size of the stone. … … 37 38 */ 38 39 unsigned int getHealth(void) const 39 { return this-> health_; }40 { return this->totalhealth_; } 40 41 41 void gotHit(){42 if (this->health_ > 0){43 this->health_ -= this->health_;44 }45 // else ~OrxoBloxStones();46 }47 42 void setGame(OrxoBlox* orxoblox) 48 43 { assert(orxoblox); orxoblox_ = orxoblox; } 49 44 private: 45 void createWall(void); 50 46 OrxoBlox* getOrxoBlox(); 51 unsigned int health_; 47 unsigned int totalhealth_; 48 unsigned int num_Stones_; 49 std::vector<OrxoBloxStones*> TotalStones_; //!< A list of all stones in a Wall. 52 50 bool delay_; 53 51 OrxoBlox* orxoblox_;
Note: See TracChangeset
for help on using the changeset viewer.