#include <acknex.h>
#include <default.c>
VECTOR* ball_force;
ENTITY* ball;
function main ()
{
level_load ("level.wmb");
ball = ent_create ("ball.mdl", vector (622,-674,0), NULL);
ph_setgravity (vector (0,0,-450));
phent_settype (ball, PH_RIGID, PH_SPHERE);
phent_setmass (ball, 3, PH_SPHERE);
phent_setfriction (ball, 80);
phent_setdamping (ball, 70,70);
phent_setelasticity (ball, 50, 20);
while (1)
{
ball_force.x = 180 * time_step * (key_cur-key_cul);
ball_force.y = 180 * time_step * (key_cuu-key_cud);
ball_force.z = 0;
phent_addtorqueglobal (ball, ball_force);
camera.x = ball.x -300;
camera.y = ball.y;
camera.z = 1000;
camera.tilt = -60;
wait(1);
}
}