I am making a simple pygame game. My problem is, when I try to check if the user is clicking the exit button, I get an error. Here's the Code:
for event in pygame.event.get():
if event.type == pygame.QUIT():
pygame.quit()
sys.exit()
Here's the error:
Traceback (most recent call last):
File "C:\Users\Rafi\Python Programs\Game.py", line 20, in <module>
if event.type == pygame.QUIT():
TypeError: 'int' object is not callable
Also, this probably doesn't but i'm on Windows 8.
TypeError.QUITis a literal, not a method. If that's the case, doingQUIT()would cause this error. Here are some examples of other code usingQUIT: nullege.com/codes/search?cq=pygame.event.get.