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

Re: [pygame] Question about timing



Francesco,

Heh, I glanced over the background to your question before answering it, but I do believe Ian is right - clock.tick() is great for keeping a game thread from running too fast, but it is not very accurate - the value passed to Clock.tick() is the max framerate, and it can often dip down depending on the logic in the loop.  what you are wanting sounds more like the opposite, which is where the wait command would come in.

--Paul

On Mon, May 12, 2008 at 11:46 AM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
It seems to me that you're going about this the wrong way.  My recommendation is to display each image with a wait command:

Surface = pygame.display.set_mode(#your largest image size)
Images = []
#(Load your images into Images[] here)
Clock = pygame.clock.Clock()
for image in Images:
    Surface.blit(image,(0,0))
    pygame.display.flip()
    pygame.time.wait(#interval in ms)