diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-24 01:22:39 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-24 01:22:39 +0200 |
commit | cd128f5bc4fae39fb7e77683758d437f64eb4203 (patch) | |
tree | f4f3efbca3e11e7f6fb73a227ad09ef11918ec48 /src/sliceitoff/game/show.py | |
parent | 4353670f0cee67550b20dfcfd51b81386372f358 (diff) |
gameover, level x and level up screens
Diffstat (limited to 'src/sliceitoff/game/show.py')
-rw-r--r-- | src/sliceitoff/game/show.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/sliceitoff/game/show.py b/src/sliceitoff/game/show.py index c3fe436..50ed0ba 100644 --- a/src/sliceitoff/game/show.py +++ b/src/sliceitoff/game/show.py @@ -1,5 +1,6 @@ """ Reads user input and does actions when game play is on. """ import pygame +from .anykey import anykey class Show: """ To show some sprites and quit on any key """ @@ -13,21 +14,13 @@ class Show: return False if self.timeout < 0: - for event in pygame.event.get(): - if event.type in ( - pygame.MOUSEBUTTONDOWN, - pygame.KEYDOWN, - pygame.QUIT): - return False + if anykey(): + return False self.fadeout -= dt self.sprites.update(explode=dt) return True - for event in pygame.event.get(): - if event.type in ( - pygame.MOUSEBUTTONDOWN, - pygame.KEYDOWN, - pygame.QUIT): - self.timeout = 0 + if anykey(): + self.timeout = 0 self.timeout -= dt return True |