我正在尝试为我的pgame添加一个开始屏幕。 代码如下:
def game_intro():
intro = True
while intro:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
pygame.display.fill(BLACK)
largeText = pygame.font.Font('Arial',10)
textSurf, textRect = text_objects("this is a game", largeText)
textRect.centre = ((display_width/2), (display_height/2))
pygame.display.blit(textSurf, textRect)
pygame.display.update()
clock.tick(15)
pygame.display.update()
score = 000
# Game loop
game_intro()
我得到的错误是:
^{pr2}$以下是所有代码:https://www.dropbox.com/s/63u9yrfzagerwhz/game_test_jakob.zip?dl=0
您正在尝试直接在“pygame.ds=isplay“模块-当它们应该在由
pygame.display.set_mode
初始化为显示的特殊表面对象上完成时插入行
在函数的开头,将对}-但保持{}不变。在
pygame.display.fill
和pygame.display.blit
的调用更改为仅display.fill
和{相关问题 更多 >
编程相关推荐