Pygame 错误:'int'对象不可调用


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.QUITint,而不是函数。尝试删除括号:

if event.type == pygame.QUIT:
running = False

最新更新