Here's what I always do:

dt = clock.tick() * 0.001
x += vx * dt
y += vy * dt

And all the sprites have a think(dt) method that updates them as if dt
seconds have passed. What else do you need?

-Christopher

On Fri, Aug 27, 2010 at 11:19 AM, James Paige <b...@hamsterrepublic.com>wrote:

> On Fri, Aug 27, 2010 at 10:59:09AM -0400, Kris Schnee wrote:
> > On 2010.8.27 10:36 AM, B W wrote:
> >> Howdy,
> >>
> >> Reviving this old thread. The comments by Patrick and Brian really
> >> intrigued me, so I pursued the topic. Found a few interesting articles
> >> and one great article. My study has resulted in a recipe for those of us
> >> continually nagged by the question, "how can I get constant game speed
> >> independent of frame rate?". The demo requires Pygame, but the clock
> >> module only requires Python.
> >
> > Isn't it simply a matter of creating a Pygame Clock object and calling
> > clock.tick() to delay until the appropriate time to maintain some max
> > framerate?
>
> That only caps a max framerate. What Gumm is talking about is when your
> framerate and your game simulation rate can be adjusted independantly
>
> ---
> James Paige
>

Reply via email to