/////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////////////////
var c_move_w;
var c_move_s;
///////////////////////////////main function ////////
function main ()
{
level_load ("level1.wmb");
video_mode = 7;
}
///////////////////////////////action myplayer ////////
action myplayer ()
{
while(1)
{
/////////////////////////////////////move
if (key_w == 1)
{
c_move(my,vector(40*time_step,0,0),NULL,GLIDE);
ent_animate(my,"walk",c_move_w,ANM_CYCLE);
c_move_w +=10*time_step;
}
if (key_s == 1)
{
c_move(my,vector(-40*time_step,0,0),NULL,GLIDE);
ent_animate(my,"walk",c_move_s,ANM_CYCLE);
c_move_s +=10*time_step;
}
//////////////////////////////////// pan
my.pan -= mouse_force.x;
my.tilt +=mouse_force.y;
////////////////////////////////////camera following
vec_set(camera.x,vector(-150,30,25)); //////////////third person camera
vec_rotate(camera.x,my.pan);
vec_add(camera.x,my.x);
vec_set(camera.pan,vector(my.pan,-10,0));
vec_set(camera.tilt,vector(my.tilt,0,0));
/////////////////////////////////////////
wait(1);
}
}