Changeset 11996
- Timestamp:
- May 24, 2018, 3:54:42 PM (7 years ago)
- Location:
- code/branches/OrxyRoad_FS18/src/modules/orxyroad
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
r11985 r11996 97 97 int trafficVelocities[]= {200,1400,500, 300}; 98 98 int velocityVariation[] = {40,80,100,20}; 99 int numObjects[] = { 60,40,30,40}; // default, spaceship, sattellite, asteroid per track99 int numObjects[] = {30,30,30,30}; // default, spaceship, satellite, asteroid per track 100 100 int streetSize[] = {3 , 1, 2, 4}; 101 101 int trackWidth = 700; … … 114 114 cubeList.push_back(cube); 115 115 int templateType = rand()%2; 116 116 117 switch(type) 117 118 { … … 137 138 }else { 138 139 cube->addTemplate("satellite");//satellite 139 } 140 } 140 141 141 142 … … 208 209 { 209 210 int type = rand() % 4; 210 orxout(user_info) << "Random : "<<type<< endl;211 //orxout(user_info) << "Random : "<<type<< endl; 211 212 212 213 roadWidth = generateStreet(type,player);//Generate street to specific type type = 0 default, type = 1 space ship type = 2 statellite/cubes, type = 3 asteroids -
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoadShip.cc
r11981 r11996 62 62 63 63 Vector3 pos = getPosition(); 64 Vector3 pos1 = getPosition();64 //Vector3 pos1 = getPosition(); 65 65 66 66 //Movement calculation … … 77 77 if (this->hasLocalController()) 78 78 { 79 float dist_y = velocity.y * dt;79 //float dist_y = velocity.y * dt; 80 80 //forward backwards movement 81 81 if(forward){ 82 if(velocity.y < 200){// Limit for max velocity83 velocity.y += 10;82 if(velocity.y < 300){// Limit for max velocity 83 velocity.y += 30; 84 84 forward = false; 85 85 } … … 88 88 }else if(backward){ 89 89 if(velocity.y > 10){ 90 velocity.y -= 10;90 velocity.y -= 30; 91 91 }else { 92 92 velocity.y = 0; // Prevent players from going backwards … … 119 119 //Left right steering 120 120 121 if(!steeredLeft&&!steeredRight){ 122 velocity.x = velocity.x *0.8; 123 } 121 124 122 125 if(steeredLeft){ 123 if(true){//if(!forward) Experimental for only allowing steering left and right when 124 velocity.x += 5; 126 steeredLeft = false; 127 if(velocity.x<100){//if(!forward) Experimental for only allowing steering left and right when 128 velocity.x += 6; 125 129 steeredLeft = false; 126 } 127 130 } 128 131 129 132 }else if(steeredRight) { 130 if(true){ 131 velocity.x += -5; 133 steeredRight = false; 134 if(velocity.x>-100){ 135 velocity.x += -6; 132 136 steeredRight = false; 133 } 137 } 134 138 }else { 135 139 if(velocity.x < -2 || velocity.x > 2 ){
Note: See TracChangeset
for help on using the changeset viewer.