From 9f8247dc4da89219b6eede08d58d96964391a077 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 27 Apr 2024 16:26:22 +0300 Subject: refactor menus and screen showing under menu subpkg --- src/sliceitoff/game/show.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/sliceitoff/game/show.py (limited to 'src/sliceitoff/game/show.py') diff --git a/src/sliceitoff/game/show.py b/src/sliceitoff/game/show.py deleted file mode 100644 index 32a87cf..0000000 --- a/src/sliceitoff/game/show.py +++ /dev/null @@ -1,24 +0,0 @@ -""" game.show - Sprite group that show sprites and skips if key is pressed """ -from .anykey import anykey -from .explodeout import ExplodeOutGroup - -class Show(ExplodeOutGroup): - """ To show some sprites and quit on any key """ - def __init__(self, sprites = None, active = True): - super().__init__(active = active) - self.add(sprites) - self.timeout = 15_000 - - def update(self, dt = 0, **kwargs): - """ First timeout then fadeout and then inactivity """ - if not super().update(dt = dt, **kwargs): - return - if anykey(): - self.do_fadeout() - if self.timeout <= 0: - self.do_fadeout() - self.timeout -= dt - - def sprites(self): - """ Return sprites only when active """ - return super().sprites() if self.active else [] -- cgit v1.2.3