Answers for "how to make a countdown in pygame"

1

how to make a countdown in pygame

start_ticks=pygame.time.get_ticks() #starter tick
while mainloop: # mainloop
    seconds=(pygame.time.get_ticks()-start_ticks)/1000 #calculate how many seconds
    if seconds>10: # if more than 10 seconds close the game
        break
    print (seconds) #print how many seconds
Posted by: Guest on July-21-2020

Code answers related to "how to make a countdown in pygame"

Python Answers by Framework

Browse Popular Code Answers by Language