Python 3.x 属性错误:模块';pygame.event';没有属性';类型';
我正在从“编写此游戏代码”学习python,在第一次尝试时遇到了一个错误: AttributeError:模块“pygame.event”没有属性“type” 源代码如下:Python 3.x 属性错误:模块';pygame.event';没有属性';类型';,python-3.x,Python 3.x,我正在从“编写此游戏代码”学习python,在第一次尝试时遇到了一个错误: AttributeError:模块“pygame.event”没有属性“type” 源代码如下: import pygame from pygame import * pygame.init() WINDOW_WIDTH = 900 WINDOW_HEIGHT = 400 WINDOW_RES = (WINDOW_WIDTH, WINDOW_HEIGHT) GAME_WINDOW = display.set_mode(W
import pygame
from pygame import *
pygame.init()
WINDOW_WIDTH = 900
WINDOW_HEIGHT = 400
WINDOW_RES = (WINDOW_WIDTH, WINDOW_HEIGHT)
GAME_WINDOW = display.set_mode(WINDOW_RES)
display.set_caption('Attack of the Vampire Pizzas!')
game_running = True
while game_running:
for events in pygame.event.get():
if event.type == QUIT:
game_running = False
display.update()
pygame.quit()
谢谢!!
DK您必须编辑“事件.类型”
”到“事件.类型”
”
if events.type == QUIT: