当我试图关闭程序窗口时,程序会冻结,然后我就不得不强制退出程序。为什么点击“X/关闭”按钮时程序不能正常关闭呢?另外,我正在使用Python 2.7版本,不知道是否有关系。
import pygame
import os, sys
from itertools import *
from oryxsprites import *
from oryxbackground import *
running = True
while running:
backgroundmain()
pygame.display.set_caption('OryxGame')
#pygame.display.set_icon(biggrasstile)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False