我正在尝试为pygame添加一个开始屏幕,但我无法让它工作,这是代码:
def game_intro():
intro = true
while intro:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
gamedisplay.fill(WHITE)
largeText = pygame.font.Font('Arial',155)
textSurf, textRect = text_objects("test", largeText)
textRect.centre = ((display_width/2), (display_height/2))
gamedisplay.blit(textSurf, textRect)
pygame.display.update()
clock.tick(15)
这是我得到的错误:
File "/Users/harrisonj11/NetBeansProjects/game_test_jakob/src/game_test_jakob.py", line 188, in <module>
game_intro()
File
"/Users/harrisonj11/NetBeansProjects/game_test_jakob/src/game_test_jakob.py", line 172, in game_intro
intro = true
NameError: name 'true' is not defined
答案 0 :(得分:0)
您可以尝试替换:
intro = true
与
intro = True