Quando vado a chiudere la finestra del programma, il programma si blocca, quindi sono costretto a forzare l'uscita dal programma. Perché il programma non si chiude quando si fa clic sul pulsante X/Chiudi. Sto anche usando python 2.7 se questo è importante.Perché la finestra di pygame non si chiude correttamente?
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
Grazie, Btw ho imparato quel codice da un altro tutorial. – enrique2334
Anche chiamare 'sys.exit()' è una buona idea. – mgold