///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
//ENTITY* car;
function main()
{
level_load ("homework18.wmb");
wait (2);
//car = ent_create("car1.mdl", vector(0,0,10), NULL);
ent_create("car1.mdl", vector(0,0,10), my_car);
while(1)
{
//camera.x = car.x;
//camera.y = car.y;
//camera.z = car.z +17;
//camera.tilt = -5;
wait(1);
}
}
action my_car()
{
while (1)
{
if (key_a)
{
my.pan += 3*time_step; // increase the pan angle of the car
//camera.pan += 3*time_step;
camera.pan = my.pan; // does same thing as above but is faster
}
if (key_d)
{
my.pan -= 3*time_step; // decrease the pan angle of the car
//camera.pan -= 3*time_step;
camera.pan = my.pan; // // does same thing as above but is faster
}
if (key_w) // press and hold the "Space" key to move the car
{
c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
}
if (key_s)
{
c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
}
camera.x = my.x;
camera.y = my.y;
camera.z = my.z +17;
camera.tilt = -5;
wait(1);
}
}