summaryrefslogtreecommitdiff
path: root/src/sliceitoff/game/show.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/game/show.py')
-rw-r--r--src/sliceitoff/game/show.py17
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