- Timestamp:
- Nov 21, 2018, 12:13:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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));
Note: See TracChangeset
for help on using the changeset viewer.