Changeset 11985 for code/branches/OrxyRoad_FS18
- Timestamp:
- May 24, 2018, 2:39:49 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
r11975 r11985 96 96 int OrxyRoad::generateStreet(int type, OrxyRoadShip* player){ 97 97 int trafficVelocities[]= {200,1400,500, 300}; 98 int numObjects[] = {60,100,40,60}; // default, spaceship, sattellite, asteroid per track 98 int velocityVariation[] = {40,80,100,20}; 99 int numObjects[] = {60,40,30,40}; // default, spaceship, sattellite, asteroid per track 99 100 int streetSize[] = {3 , 1, 2, 4}; 100 101 int trackWidth = 700; … … 104 105 int sign = rand()%2; 105 106 106 orxout(internal_error) << sign<< endl;107 //orxout(internal_error) << sign<< endl; 107 108 108 109 … … 150 151 } 151 152 152 int distance = trafficVelocities[type]*3; //Todo better calculation of distance between objects 153 int posVar = rand()%2; 154 int distance = trafficVelocities[type]*3 +posVar*trafficVelocities[type]/10; //Todo better calculation of distance between objects 153 155 154 cube->setPosition(player->getWorldPosition() + Vector3( 1000.0f+j*trackWidth, 0.0f, i*distance+j*trackWidth));156 cube->setPosition(player->getWorldPosition() + Vector3(2000.0f+j*trackWidth, 0.0f, i*distance)); 155 157 156 158 /* experimental */ … … 158 160 159 161 if(sign>=1){ 160 cube->setVelocity(0,0,trafficVelocities[type] );162 cube->setVelocity(0,0,trafficVelocities[type]*level+velocityVariation[j%3]); 161 163 } else{ 162 cube->setVelocity(0,0,-trafficVelocities[type] );164 cube->setVelocity(0,0,-trafficVelocities[type]*level+velocityVariation[j%3]); 163 165 } 164 166 … … 193 195 for(unsigned int i=0; i < cubeList.size();i++) 194 196 { 195 if(cubeList.at(i)->getPosition().x < currentPosition- 3000)197 if(cubeList.at(i)->getPosition().x < currentPosition-500) 196 198 { 197 199 cubeList.at(i)->destroy(); … … 203 205 204 206 205 if(counter >= roadWidth )207 if(counter >= roadWidth-200) 206 208 { 207 209 int type = rand() % 4;
Note: See TracChangeset
for help on using the changeset viewer.