What is the difference between .quit and .QUIT in pygame
I just want to know the difference between .quit
and .QUIT
in pygame. I've tested both but I continue to not understand how they work.
QUIT
is the enumerator constant for an event type (see event
module). The quit event occurs when the pygame window is closed:
for event in pygame.event.get():
if event.type == pygame.QUIT:
# [...]
quit()
is a function which uninitialize all pygame modules. This function should be called at the end of the applicaiition:
# initialize all imported pygame modules
pygame.init()
# application loop
while True:
# [...]
# uninitialize all pygame modules
pygame.quit()