#include <acknex.h>
#include <default.c>
VECTOR vSpeed, vAngularSpeed, vForce, vMove, vKick, velocity, vec;
var walk_speed, cabin_rotate, gun_rotate;
action mech()
{
set(my,SHADOW);
my.material = mat_metal;
camera.y = my.y - 50*sin(my.pan);
camera.x = my.x - 50*cos(my.pan);
camera.z = my.z + 230;
camera.tilt = -10;
camera.pan = my.pan-180;
while(1)
{
ent_animate(my, NULL, 0, 0); // reset all the animations
walk_speed += 4 * time_step; // increase walk_speed; 1.5 sets the speed
gun_rotate -= mouse_force.y;
cabin_rotate -= mouse_force.x;
if (key_w){
ent_animate(my, "walk", walk_speed, ANM_CYCLE);
c_move(me,vector(-3*time_step,0,0),nullvector,IGNORE_YOU|GLIDE);
my.pan += 2;
}
ent_bonerotate(my,"railgun",vector(0,gun_rotate,0 ));
ent_bonerotate(my,"cabin",vector(cabin_rotate,0, 0));
if(!c_trace (my.x,vector(0,0,-1),IGNORE_ME|IGNORE_PASSABLE)){
c_move(me,vector(0,0,-30*time_step),nullvector,IGNORE_YOU|GLIDE);
}
wait(1);
}
}
function main()
{
level_load("terrain_desert.hmp");
//shadow_stencil = 1;
wait(3);
ph_setgravity(vector(0,0,-386));
ent_create("mech_walk.mdl",vector(0,0,200),mech);
}