python - Countdown timer in Pygame - Stack Overflow
In pygame exists a timer event. Use pygame. time. set_timer() to repeatedly create an USEREVENT. e. g. : timer_interval = 500 # 0. 5 seconds timer_event = pygame. USEREVENT + 1 pygame. time. set_timer(timer_event , timer_interval) Note, in pygame customer events can be defined. Each event needs a unique id.
more
|