Gravity reacts equally on every object, but what makes some object fall faster than other? A rock falls faster than a paper, agreed?
There are two variables to this, Mass and Aero-dynamic. A rock has more mass, thus more particle is attracted towards the center of the earth, so it will take more to stop this one's movement and on top of that, it is quite aero-dynamic (Depends on a rock... think of a round one). While a peice of paper is barely massive at all, it takes less energy to stop the paper from moving, and it's aero-dynamic is rather poor, considering the paper tends to move more horizontally.
So how do we replicate this in our game???
Easy enough! You keep the same gravity, but you limit it! heres an easy way:
- Code: Select all
yvelocity=min(4,yvelocity+1);//instead of yvelocity++
this will limit yvelocity to 4.
Hope this helps!