-1
我试图为每个10分钟背景更改的游戏制作日夜功能,但是当我运行它时,它只是在启动时崩溃。这是错误的代码。Pygame中的日夜修理工无法正常工作
bg = pygame.image.load("bg.png")
bgg = pygame.image.load("bbg.png")
def bg1():
screen.blit(bg, (0, 0))
def bbg1():
screen.blit(bbg, (0, 0))
def fbg():
bg1()
pygame.time.wait(10000)
bbg1()
screen.fill((0,0,0))
fbg()
我有screen.fill((0,0,0)),因为有一个矩形有作为其四处移动。
等待命令冻结你的应用程序的执行10分钟..我不认为这是你想要的... – Mailerdaimon 2015-02-11 10:55:56
是'崩溃'只是游戏等待10分钟? – 2015-02-11 10:56:00
见:http://stackoverflow.com/questions/18839039/what-are-the-best-approaches-to-wait-some-time-in-pygame-and-python-code-in-gene – Mailerdaimon 2015-02-11 10:56:45