- Timestamp:
- May 24, 2018, 3:54:42 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.