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

Re: [pygame] p4a animation lag



On Fri, Dec 30, 2011 at 8:00 AM, Sean Wolfe <ether.joe@xxxxxxxxx> wrote:
Don't have to click for every frame, it will run the whole list of
frames on a single mousebuttondown.
That wasn't really my point; graphics is only being drawn when the user clicks.  Generally input and graphics are disassociated.  I see that this way allows you to only redraw when you need to, but it's a bad idea in general.

However, given that this *is* your desired behavior, I suspect the actual problem to be with the clock.tick calls.  When passed a framerate argument, the clock will attempt to average over a certain number of time samples to get a proper framerate.  You're only ever calling tick when there's a mouse event, so the average will get screwed up.  Also, it's set to 10fps, which is kinda low.

Ian