How do you delay specific events in a while loop?

前端 未结 3 1202
一个人的身影
一个人的身影 2020-12-22 09:41

Recently I\'ve been working with a simple and straightforward RPG in python with pygame, but I\'m having some problems delaying specific events. Running the

3条回答
  •  温柔的废话
    2020-12-22 10:28

    You can use

    pygame.time.delay(n)
    

    or

    pygame.time.wait(n)
    

    to pause the program for n milliseconds. delay is a little more accurate but wait frees the processor for other programs to use while pygame is waiting. More details in pygame docs.

提交回复
热议问题