Python Forum

Full Version: Int object not callable error!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import pygame
pygame.init()

gameDisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption("Simple dodging game")
clock = pygame.time.Clock()
crashed = False

while not crashed:
    for event in pygame.event.get():
        if event.type == pygame.QUIT():
            crashed = True
        print(event)
    pygame.display.update()
    clock.tick(60)

pygame.quit()
quit()
Error:
if event.type == pygame.QUIT(): #If player wants to quit the game TypeError: 'int' object is not callable
I'm not for sure what this means. Anything advice helps :)
remove the parenthesis on QUIT
if event.type == pygame.QUIT:
(Nov-14-2018, 02:59 AM)metulburr Wrote: [ -> ]remove the parenthesis on QUIT
if event.type == pygame.QUIT:

Thank you very much!