import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT():
running = False
当执行此代码时,我得到以下错误:
'int' object is not callable
pygame.QUIT
是int
,而不是函数。尝试删除括号:
if event.type == pygame.QUIT:
running = False