[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] A way of telling time?
Hi,
I just dug fairly deep and discovered pygame.time.set_timer(), but it looks like I can only have 2 events at one time. This might work for the simulation game I'm working on, but yes, I would like to determine the progression of time. Oh, I should probably mention that one of my needs is a countdown timer that starts at 365 seconds and stops at 0.
Thanks for your reply,
Joe
PS> I don't want to use time.sleep because the game needs to blit things to the screen while it's waiting.
On 8/5/07,
Luke Paireepinart <rabidpoobear@xxxxxxxxx> wrote:
Joseph Quigley wrote:
> Hi,
> I'm using PGU and Pygame and would like to fairly accurately calculate
> when 1 second has passed. What is the best way of doing this?
> Thanks,
> Joe
The
pygame.time module is probably what you're looking for.
Do you want to wait for a second, or do you want to be able to determine
the progression of time?
Because if the latter, you could probably use the builtin time module.
However, I bet Pygame's waits are more accurate than time.sleep.
-Luke
--
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2