I made a code for a bowling ball, everything looks just fine but I want to add curve to it whenever you throw the ball, I already have a code for setting the force and the direction for the ball, take a look at the ball code:
if(set_posforce >= 3)//ig the position and the force are already set then
{
vec_set(me.x,vector(camera.x,camera.y + 100,camera.z-15));
phent_settype(me,PH_RIGID,PH_SPHERE ); // create a ball
phent_setmass(my, 100,PH_SPHERE);
phent_setdamping (me, 10 ,0);
phent_setelasticity(me,30,50);
friction -= force_throw + 20; //set friction depending on the force
friction = clamp(friction,20,100);
phent_setfriction(me,friction);
if(force_throw > 70)//force too high
{
phent_addvelcentral(me,vector(x_direction * 5, (force_throw * 11),0));
}
else
{
phent_addvelcentral(me,vector(x_direction * 2, (force_throw * 15),0));
}
ball_rolling = true;
}
So what do I have to add to get the curve effect?
This is the actual game, thanks for reading.
Edit: here's video showing what I want to achieve
http://www.youtube.com/watch?v=dzp4D_2D2AE