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

Re: [pygame] Pygame: Fixed timestep demo?



Jake,

Ian is correct. For meager demands pygame.time.Clock may suffice.

Here is a discussion on this mailing list, which starts out small, then goes into some great detail about advanced needs, how and why, as well as some cautions. Maybe more than you want. You can decide how far to go down the rabbit hole.

http://archives.seul.org/pygame/users/Jan-2010/msg00146.html
http://archives.seul.org/pygame/users/Feb-2010/msg00020.html
http://archives.seul.org/pygame/users/Aug-2010/msg00079.html

Many folks roll their own. At least a few have taken a whack at making something reusable.

http://www.pygame.org/wiki/ConstantGameSpeed (latest here, though changes are untested in the field)
http://www.pygame.org/pcr/fpstimer/index.php
http://www.pygame.org/project-Game+Clock+demo-438-.html

None of them require a physics library.

Gumm

On Mon, May 2, 2011 at 7:20 AM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
Basically, just use pygame.time.Clock to maintain a constant framerate.


On Mon, May 2, 2011 at 5:40 AM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
What's the suggested way to use a fixed time step in pygame? I want to
verify I'm using the right method. I want it for the case when you're
not using a physics lib.

( There's resources at gaffer, and stackoverflow,  )
but none specifically pygame that I found.

Do you know of an example?

--
Jake