first create an object;
then use:
phent_settype (ball, PH_RIGID, PH_SPHERE); to register it as a physics item
in order for the ball to fall you need to apply an initial gravity
use: ph_setgravity (vector(0, 0, -386));
then you can choose the different attributes of the physics item:
phent_setmass (ball, 3, PH_SPHERE); // controlls mass and weight distribution
phent_setfriction (ball, 80); // set the friction against other objects
phent_setdamping (ball, 40, 40); // set the damping which is air resistance
phent_setelasticity (ball, 50, 20); // set the elasticity or bounciness
after you do that it will roll and bounce in order to make it move using
controlls you need to use this:
while (1)
{
ball_speed.x = 25 * (key_cur - key_cul); // move the ball using the cursor keys
ball_speed.y = 25 * (key_cuu - key_cud); // 25 sets the x / y movement speeds
ball_speed.z = 0; // no need to move on the vertical axis
phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball
camera.x = ball.x - 300; // keep the camera 300 quants behind the ball
camera.y = ball.y; // using the same y with the ball
camera.z = 1000; // and place it at z = 1000 quants
camera.tilt = -60; // make it look downwards
wait (1);
}
that pretty much sums up that peice of code.
if you still dont get it I don't know what to tell you.