var video_mode=7;
var video_depth=32;
var move_vec[3]=0,0,0;
var idle_percent=0;
var walk_percent=0;
var temptilt = 0;
action display_glass
{
my.alpha = 25;
my.transparent = on;
}
action player_move
{
player = me;
wait(1);
Camera.genius = player;
while (player !=NULL)
{
move_vec[0] = (key_w - key_s + key_cuu - key_cud ) * 20 * time; //moving forward and backward
move_vec[1] = (key_a - key_d + key_comma - key_period) * 15 * time; //strafe movements
player.pan -= (mouse_force.x) * 100 * time; //using the mouse, left and right arrow keys to turn left and right
move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE; // move mode parameters to avoid sticking on walls and models
player.tilt-= mouse_force.y * -200 * time;
ent_move(move_vec,NULLVECTOR);
If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent +5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}
vec_set (Camera.x,player.x);
camera.z += 27;
camera.pan = player.pan;
Camera.tilt =Player.tilt*4*time;
wait(1);
}
}
function main()
{
level_load("Level1.wmb");
wait(2);
}