0

this code that i wrote runs fine in my ide and the exe version. but the problem arises when i try to close the program. it shows me this error(and yes, i've imported sys and used sys.exit() instead of quit().):

File "source.py", line 77, in File "source.py", line 41, in main for event in pygame.event.get(): NameError: name 'quit' is not defined

my game is almost done, and this is the only thing that bothers me. any help would be appreciated.

icekete
  • 25
  • 1
  • 4
  • 2
    can you post the code that the error is reffering to? – Tony Aug 17 '21 at 10:31
  • 1
    If `source.py` doesn't contain `quit`, but the error message talks about it anyway, this could mean you 1) didn't save the file; and/or 2) didn't rebuild the exe after changing the code to use `sys.exit` – ForceBru Aug 17 '21 at 10:37

1 Answers1

0

You need to write pygame.QUIT instead of quit

LuckyLuke
  • 1
  • 1