Pygame在没有错误的情况下添加图形时崩溃

时间:2016-10-17 14:15:25

标签: python-2.7 pygame

所以看起来每次我运行pygame时,它都会在我尝试添加图形时崩溃。例如,此代码有效:

import pygame, sys
pygame.init()
screen = pygame.display.set_mode([640, 480])
#screen.fill([255,255,255])
#pygame.draw.circle(screen, [255,0,0],[100,100], 30, 0)
pygame.display.flip()
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
pygame.quit()

然而,当我删除井号时,pygame窗口将闪烁然后立即关闭并出现崩溃报告。 Python也没有识别我的代码中的任何错误。有人可以指出为什么有screen.fill和pygame.draw行导致pygame崩溃。

我正在使用mac和python 2.7.9

0 个答案:

没有答案