VECTOR dist; // this must be out of the loop
my.pan += 10 * (key_cur - key_cul) * time_step; // turn my pan (my here is PLAYER)
if(!key_x) // if key_x isn't pressed
{
if(key_v) // if running
{
dist.x = 20 * (key_cuu - 0.4 * key_cud) * time_step; // 20 running speed 0.4 reduces backwards speed
}
else
{
dist.x = 10 * (key_cuu - 0.8 * key_cud) * time_step; // 10 running speed 0.8 reduces backwards speed
}
}
move_friction = 0.1; // this is movement friction, play with it
c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE); // don't use "+" here, better "|"