#include <acknex.h>
#include <default.c>
///////////////////////////////
ENTITY* car1;
var car1_speed=50;
function main()
{
level_load ("homework18.wmb");
wait (2);
car1= ent_create ("car1.mdl",vector (0,0,0 ),NULL);
ph_setgravity (vector(0,0,-386));
phent_settype (car1, PH_RIGID,PH_BOX);
phent_setmass (car1,50, PH_BOX);
phent_setfriction (car1,80);
phent_setdamping (car1,40,40 );
phent_setelasticity (car1, 50, 20);
while(1)
{
camera.x=car1.x;
camera.y=car1.y;
camera.z=car1.z;
camera.tilt=car1.tilt;
camera.pan=car1.pan;
bewegung();
wait (1);}
}
}
function bewegung ()
{var temp[3];
while (1)
{
if (key_space==1)
{phent_addcentralforce(car1,car1_speed);
vec_for_angle( temp, car1.pan);
vec_normalize( temp, 1*time_step);
}
if (key_cul==1)
{phent_addtorquelocal (car1,temp);
}
{
wait(1);
}}