action main_player() //control the player
{
while (1) //wait 1
{
if (key_a)
my.pan += 19*time_step; //if key A is pressed turn left
if (key_d)
my.pan -= 19*time_step;//if key D is pressed turn right
if (key_w)
c_move (my, vector(12 * time_step, 0, 0), nullvector, GLIDE); //if key W is pressed go forward
if (key_space) me.z +=8; //if space is pressed jump
if (me.z > 20) me.z -=0.4; //if the player is above z.20 then glide down at 0.4 speed
wait (1);
camera.x = my.x+100; // camera location behind the player
camera.y = my.y; // camera left/right placement
camera.z = my.z+50; // camera height
camera.tilt = -25; // make it look downwards
wait (1);
}
}