Quote:
Originally Posted by Kalimba
Imagine that the velocity at the start of your game loop is (0.1, 0.1). What happens to the velocity during the game loop? Then imagine how your game loop behaves every subsequent time it's called.
|
OK, since I was decrementing (is that a word?) it by .2, when friction is applied to a speed of .1 it becomes negative on both the x and y coordinates and then, being below zero, no more friction is applied and it just drifts up and to the left.
Thanks.
Still, what I've written -while it now comes to a complete stop - isn't as realistic as I'd like, particularly near the end. What happens now is that as the ball slows it sort of flattens out on the x axis . That is, it seems that it seems that it reaches 0 y speed before it reaches 0 x speed and the result is that it always end traveling exactly horizontally right at the end rather than ending on a diagonal path.
Is there a better way to apply friction?