set events

This commit is contained in:
Waylon Walker 2023-01-01 14:08:21 -06:00
parent ff84817732
commit 1f844dae9d
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
15 changed files with 1448 additions and 1 deletions

View file

@ -14,7 +14,7 @@ class Game:
self.surfs = []
def should_quit(self):
for event in pygame.event.get():
for event in self.events:
if event.type == pygame.QUIT:
self.running = False
@ -26,6 +26,7 @@ class Game:
def run(self):
while self.running:
self.events = pygame.event.get()
self.should_quit()
self.reset_screen()
self.game()