The import sys
The import pygame
Def run_game () :
Pygame. The init ()
Screen=pygame. Display. Set_mode ((1200800))
Pygame. Display. Set_caption (' Alien night ')
While True:
For the event in pygame. Event. The get () :
If the event. The type==pygame. QUIT:
Sys. The exit ()
Pygame. Display. Flip ()
Run_game ()
CodePudding user response:
The answer of torture, a day or twoCodePudding user response:
Error information display module pygame didn't QUIT this attributeThe QUIT this attribute is pygame. Locals
So you want to import like this:
The from pygame. Locals import *
Then
While True:
For the event in pygame. Event. The get () :
If the event type==the QUIT:
The exit ()
CodePudding user response:
I find a way to solve, I have encountered this problem...