Page 1 of 1

yvelocity plz

PostPosted: Tue Feb 01, 2011 10:41 pm
by ThaKid244
hi. I am needing to learn the basic concepts of yvelocity. i understand that it is a very important concept and i want to fully understand it.
what does yvelocity<4 mean?
what does yvelocity+=.8 mean?
yvelocity/2?
yvelocity>=0?
thank you

Re: yvelocity plz

PostPosted: Wed Feb 02, 2011 12:15 am
by sonicfire
its speed per pixels...as far as i remember. it gives your actor a constant movement/speed.

what does yvelocity<4 mean? <- check if yvelocity is smaller then 4!
what does yvelocity+=.8 mean? <- it means yvelocity = yvelocity + 0.8
yvelocity/2? <- would half the value of velocity
yvelocity>=0? < if yvelocity is bigger than or equal to zero!

Re: yvelocity plz

PostPosted: Wed Feb 02, 2011 12:56 am
by ThaKid244
what is the yvelocity of a player if he is just standing on the ground being still?
what is the yvelocity of a player at the top of his jump?

Re: yvelocity plz

PostPosted: Wed Feb 02, 2011 5:11 am
by schnellboot
xM0rtalKomb4tx wrote:what is the yvelocity of a player if he is just standing on the ground being still?
what is the yvelocity of a player at the top of his jump?

you have to decide it yourself ..

Re: yvelocity plz

PostPosted: Wed Feb 02, 2011 7:19 am
by skydereign
Well, for those two spots, the yvelocity are zero. Usually you would have a draw actor event for your player that increases yvelocity. That way, you have a gravity effect. When you jump, you set the player's yvelocity to some negative number (so he goes up). Each frame the draw event reduces the yvelocity. When it reaches zero, the player is at the top of the jump, and later begins to fall.