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

Re: [pygame] Semi-Neophyte requires jerky animation assistance



On 4/10/06, Kevin Turner <darian@xxxxxxxxxxxxx> wrote:
> I've been working on a pygame based game for a project, and I've
> encountered a weird phenomen in terms of animation. Every second or so,
> there's a "jerk" where everything stops animating for about a quarter
> of a second and then resumes. This isn't a full fledged freeze but more
> a drop in fps to 0 for the quarter second.
>
> Has anyone else encountered a similar problem before?
>

I also develop on a laptop, and frequently get this problem. It always
occors when I try and run at the fastest frame rate possible. I
suspect it has something to do with the power saving / cpu scaling
features ony my CPU and video card.

The best solution is to turn on the 'sync to vertical retrace' setting
in your video drivers. You can't do this in a cross platform manner
from from pygame, unfortunately.

The next best solution is to force pygame to use a set framerate using
Clock().tick, as Rene suggested.

-Sw.