Changeset 12116
- Timestamp:
- Nov 21, 2018, 12:13:54 PM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
r12111 r12116 48 48 numCells="<?lua print(N)?>" 49 49 cellSize="<?lua print(S)?>" 50 level=1 50 51 /> 51 52 </attached> … … 66 67 <SpawnPoint 67 68 team=0 68 69 69 70 position="<?lua print(S*0)?>,40,<?lua print(8*S)?>" 70 71 lookat="0,40,0" -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
r12111 r12116 63 63 this->wayPoints = std::vector<OrxoKartTile*>(3, nullptr); 64 64 65 int n = this->origin_->getNumCells(); 66 int s = this->origin_->getCellSize(); 65 this->n = this->origin_->getNumCells(); 66 this->s = this->origin_->getCellSize(); 67 this->level = this->origin_->getLevel(); 67 68 int map_1[] = {1,1,1,1,1,1,1,1,0,0,0 68 69 ,1,0,0,0,0,0,0,1,1,1,0 … … 105 106 106 107 107 int *levelcodeArray = map_1;108 int *levelcodeArray = level==1 ? map_1 : map_2; 108 109 109 110 // int z = 0; … … 116 117 // tiles.push_back(tile); 117 118 //++z; 118 if ( i == 10 && j == 4 ) 119 wayPoints.at(0) = tile; 119 if (level == 1) { 120 //map 1 121 if ( i == 10 && j == 4 ) 122 wayPoints.at(0) = tile; 120 123 121 if ( i == 0 && j == 0) 122 wayPoints.at(1) = tile; 123 if ( i == 10 && j == 7) 124 wayPoints.at(2) = tile; 124 if ( i == 0 && j == 0) 125 wayPoints.at(1) = tile; 126 if ( i == 10 && j == 7) 127 wayPoints.at(2) = tile; 128 } 129 else if (level == 2) { 130 //map 2 131 if ( i == 24 && j == 11 ) 132 wayPoints.at(0) = tile; 133 134 if ( i == 0 && j == 0) 135 wayPoints.at(1) = tile; 136 if ( i == 24 && j == 17) 137 wayPoints.at(2) = tile; 138 } 125 139 } 126 140 } … … 166 180 if(flag_->getCollided()){ 167 181 OrxoKartKart* player = flag_->getObjectofCollision(); 168 player->setPosition(Vector3(80*0, 20, 80*8)); 182 if (level == 1) 183 player->setPosition(Vector3(s*0, 20, s*8)); 184 if (level == 2) 185 player->setPosition(Vector3(s*0, 20, s*19)); 169 186 player->setOrientation(Quaternion(1, 0, 0, 0)); // 0, 0, 0 170 187 player->setVelocity(Vector3(0,0,0)); -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h
r12111 r12116 67 67 int numberOfFlags_; 68 68 bool firstTick_; 69 70 int s; 71 int n; 72 int level; 69 73 }; 70 74 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc
r12090 r12116 53 53 XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode); 54 54 XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode); 55 XMLPortParam(OrxoKartOrigin, "level", setLevel, getLevel, xmlelement, mode); 55 56 } 56 57 -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h
r12090 r12116 61 61 { return this->cellSize_; } 62 62 63 inline void setLevel(int level) 64 { this->level_ = level; } 65 inline int getLevel() const 66 { return this->level_; } 67 63 68 private: 64 69 void checkGametype(); … … 66 71 int numCells_; 67 72 int cellSize_; 73 int level_; 68 74 }; 69 75 }
Note: See TracChangeset
for help on using the changeset viewer.