allow quitting with the esc key

This commit is contained in:
Nicholas Dyer 2023-02-19 16:15:27 -05:00
parent ec6dfc9ee4
commit 023ebd9432
No known key found for this signature in database
GPG Key ID: E4E6388793FA2105

View File

@ -22,6 +22,9 @@ def main(windowed_mode):
running = False
if event.type == pygame.MOUSEBUTTONDOWN:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
running = False
pygame.display.flip()