Even minor lag, strongly affects my player's movement (it's a marble). I get the impression I'm just doing something wrong.


Ok, so here is a (cut down version) my player action:

action player_act
{
...
player = my;
...
while(1)
{
...
phent_settype(my,ph_rigid,ph_sphere);
phent_setmass(my,10,ph_sphere);
phent_setfriction (my, 0);
phent_setdamping(my, 90, 30);
phent_setelasticity (my, 0, 20);
phent_setgroup(my, 1);
ph_selectgroup(1);

//moving
vec_set(dir,nullvector);
if(key_a == 1){dir.y+=1;}
if(key_d == 1){dir.y-=1;}
if(key_s == 1){dir.x-=1;}
if(key_w == 1){dir.x+=1;}

vec_set(tempvec1,camera.pan);
tempvec1[1] = 0;
vec_rotate(dir,tempvec1);
vec_normalize(dir,10000*time);
phent_addforceglobal(my,dir,my.x);

vec_set(dir,nullvector);
dir.z = 1;
vec_normalize(dir,100000*time);

phent_addforceglobal(my,dir,my.x);
...
wait(1);
}
...
}


Everything else in my game runs fine, because I use * time. I've not been able to get this effect with physics, even a small blip will cause the player to jump three times as high.

Any help? I'm sure this is my fault, I'm just looking to learn people's methods for dealing with this?


My games - www.spyeart.com