yvelocity limit using this code?
Posted: Tue Apr 03, 2012 6:13 am
Hi, I was wondering how I can make this work? I tried only once, but I figured it'd be easier to ask on the forums. If I find it out before anyone answers, I'll delete this post :3
but no matter what code I try, he always vanishes in 1 frame DX... I even tried this
O-o
EDIT:
got him to stop vanishing, but now he stays at a velocity of 10
^^
- Code: Select all
yvelocity+=1+max(0, min(yvelocity, 10));
but no matter what code I try, he always vanishes in 1 frame DX... I even tried this
- Code: Select all
yvelocity+=max(.3, min(.3, .3));
O-o
EDIT:
got him to stop vanishing, but now he stays at a velocity of 10
- Code: Select all
yvelocity+=.3;
yvelocity=max(10, min(yvelocity, -12));
^^