set events
This commit is contained in:
parent
ff84817732
commit
1f844dae9d
15 changed files with 1448 additions and 1 deletions
3
game.py
3
game.py
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue