1 // If this gun shoots off a bit, modify the directions 2 if (BulletDetails.u32DegreesOff) 3 { 4 cpFloat RandomDegrees = (cpFloat)(((S32)rand() % (S32)BulletDetails.u32DegreesOff) - 5 (S32)BulletDetails.u32DegreesOff/2); 6 7 mpBody->a += RandomDegrees*(PI/180.0f); 8 9 mpBody->v.x=cos( mpBody->a)*BulletDetails.Speed; 10 mpBody->v.y=sin( mpBody->a)*BulletDetails.Speed; 11 12 } 13