Page 1 of 1

yvelocity limit using this code?

PostPosted: Tue Apr 03, 2012 6:13 am
by Hblade
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

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 :P
Code: Select all
    yvelocity+=.3;
    yvelocity=max(10, min(yvelocity, -12));


^^

Re: yvelocity limit using this code?

PostPosted: Tue Apr 03, 2012 6:43 am
by skydereign
You mean like this?
Code: Select all
yvelocity = max(0, min(yvelocity+1, 10));

Re: yvelocity limit using this code?

PostPosted: Tue Apr 03, 2012 6:40 pm
by Hblade
Thanks! +1