how to make a countdown in pygame

Solutions on MaxInterview for how to make a countdown in pygame by the best coders in the world

showing results for - "how to make a countdown in pygame"
Badis
09 Oct 2018
1start_ticks=pygame.time.get_ticks() #starter tick
2while mainloop: # mainloop
3    seconds=(pygame.time.get_ticks()-start_ticks)/1000 #calculate how many seconds
4    if seconds>10: # if more than 10 seconds close the game
5        break
6    print (seconds) #print how many seconds