Python Forum
[PyGame] Int object not callable error!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Int object not callable error!
#1
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 :)
Reply
#2
remove the parenthesis on QUIT
if event.type == pygame.QUIT:
Recommended Tutorials:
Reply
#3
(Nov-14-2018, 02:59 AM)metulburr Wrote: remove the parenthesis on QUIT
if event.type == pygame.QUIT:

Thank you very much!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  'module' object is not callable lilCasio 2 9,578 Apr-20-2017, 02:31 AM
Last Post: Low_Ki_

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020