所以我想做一個遊戲... 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