due to numerical instabilities
You talk about the bouncing ball right? Going higher and higher for no obvious reason. Normal flawy code is like this:position=position+velocity velocity=velocity+acceleration If [ball hit floor] Then velocity=-velocityThe ball will gain more and more height, because when the ball hit the floor, first acceleration due to gravity is added, then velocity is inverted, resulting in the ball launching upwards with greater speed than it came down with, the fix however is simple:
position=position+velocity velocity=velocity+½acceleration If [ball hit floor] Then velocity=-velocity velocity=velocity+½accelerationThis can be made a bit smoother:
position=position+velocity+½acceleration velocity=velocity+acceleration If [ball hit floor] Then velocity=-velocity