Would anyone know how you would code a timer to be displayed on screen in pygame, where the time is going up as the user is playing?
Asked
Active
Viewed 2,142 times
-2

Feargus
- 21
- 1
- 5
-
1If you have a problem you can post what you've tried with a clear explanation of what isn't working and provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). I suggest reading [How to Ask](http://stackoverflow.com/help/how-to-ask) a good question. Also, be sure to take the [tour](https://stackoverflow.com/tour) – Yash Karanke Dec 01 '17 at 19:22
-
example with [analog clock](https://github.com/furas/python-examples/tree/master/pygame/clock) – furas Dec 01 '17 at 19:26
1 Answers
0
This link might be helpful
http://www.pygame.org/docs/ref/time.html#pygame.time.get_ticks
You can do something like this
start_ticks=pygame.time.get_ticks()
while mainloop:
seconds=(pygame.time.get_ticks()-start_ticks)/1000
if seconds>10:
break

Akshay Bahadur
- 497
- 4
- 11