所以我想做一个游戏... pygame似乎并没有为我工作。我得到这个错误,“python error python 3.5 pygame
AttributeError: module 'pygame' has no attribute 'init'"
和我用尽所有其他论坛,并不能找到帮助......我的比赛被称为辊和我使用的是正确的pygame的。我该怎么办?
import pygame
pygame.init()
gamedisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption('roll.io')
clock = pygame.time.Clock()
dead = False
while not dead:
for event in pygame.event.get():
if event.type == pygame.QUIT:
dead = True
print(event)
pygame.display.updat()
clock.tick(30)
pygame.quit()
quit()
是您的文件名为'pygame.py',或者你有一个叫'pygame.py'比pygame的本身以外的任何文件? –
你使用的是最新版本的pygame吗? –
'pygame .__ path__'打印什么? – PseudoAj