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

Re: [pygame] time progression independent of game "ticks"



You could try: "http://www.pygame.org/docs/ref/time.html#pygame.time.Clock" with Clock.tick(framerate) which would normalize the speed of the program on any computer.  Then you wouldn't have to deal with any of the annoying stuff.  Of course this means that cutting edge computers would have no faster a fps rate than their slower counterparts.
Ian

On 7/19/07, Daniel Nixon <dan.nixon@xxxxxxxxx> wrote:
Hi list,

I'm working on a game in which the player looks after a fishtank full
of fish. Each fish ages, gestates while pregnant, grows hungrier, etc.
For arguments sake lets say 15 minutes = 1 fish year. I want this
passage of time to be independent of frame rate and iterations through
the main game loop (or do I?).

What is the best way to go about such a thing? Use MVC and run the
model in its own thread? If that is the case what is the best way to
keep track of the passage of actual time within the model?

Thanks for reading.

--
Regards
Daniel Nixon