0
如何在choice_f()
和draw_f()
的功能之間暫停?如何在兩個功能之間暫停?
while keepGoing:
for event in pygame.event.get():
if event.type==pygame.QUIT:
keepGoing=False
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_SPACE:
choice_f()
#I want a pause here.
draw_f()
pygame.display.update()
pygame.quit()
非常感謝您的幫助。
注:有'pygame.time.delay()'。它使你的延遲更準確。 –
我做到了。當我編寫這段代碼時,函數choice_f()會在暫停後執行。我無法理解爲什麼函數的順序被忽略。 如果我理解正確。首先,應該執行函數choice_f(),然後執行time.sleep(5),然後執行draw_f()。但我首先運行time.sleep(5),然後選擇choice_f()和draw_f()。爲什麼我不知道。 –