action main_player() //control the player
{
var walk_percentage = 0;
while (1)
{
my.pan += (key_a - key_d)*5*time_step; //rotate the entity using [A],[D]
var distance = (key_w - key_s)*5*time_step;
c_move(me, vector(distance,0,0), NULL, GLIDE); //move it using [W],[S]
walk_percentage += distance;
ent_animate(me, "walk", walk_percentage, ANM_CYCLE); //animate the entity
wait (1);
}
}