十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
本文为大家分享了pygame游戏之旅的第13篇,供大家参考,具体内容如下

定义暂停函数:
def paused():
largeText = pygame.font.SysFont('comicsansms',115)
TextSurf, TextRect = text_objects('Paused', largeText)
TextRect.center = ((display_width/2),(display_height/2))
gameDisplay.blit(TextSurf, TextRect)
while pause:
for event in pygame.event.get():
print(event)
if event.type == pygame.QUIT:
pygame.quit()
quit()
## gameDisplay.fill(white)
button("Continue", 150, 450, 100, 50, green, bright_green,game_loop)
button("Quit",550, 450, 100, 50, red, bright_red,quitgame)
pygame.display.update()
clock.tick(15)