[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Why does my ball vibrate?



I actually got interested in the problem, and tried to recreate your code, even though you practically gave it to me.  Had to sleep though :) I'll finish when I get home. 

Anyway, as long as the physics time engine is based on your fps, any point when the window is moved will cause a drop in the fps.  I recommend timing the loop and getting an average speed going.  Then, pause the simulation if the loop time is longer than that.  That way, when you release-click, the ball will move from where it started. 

You could just forget timing and estimate, which I don't recommend if you want accuracy. 

Ian