From 27c7e16e4bd808ce1176f18b7a78c02ff4fa88ee Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Thu, 28 Mar 2024 23:34:19 +0200 Subject: fonts under text, more sprite.Groups --- src/sliceitoff/game/show.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sliceitoff/game/show.py') diff --git a/src/sliceitoff/game/show.py b/src/sliceitoff/game/show.py index 018e555..b9b684b 100644 --- a/src/sliceitoff/game/show.py +++ b/src/sliceitoff/game/show.py @@ -1,4 +1,4 @@ -""" Reads user input and does actions when game play is on. """ +""" Sprite group that show sprites and skips if key is pressed """ import pygame from .anykey import anykey @@ -13,6 +13,7 @@ class Show(pygame.sprite.Group): self.timeout = 15_000 def update(self, dt = 0, **kwargs): + """ First timeout then fadeout and then inactivity """ super().update(dt = dt, explode = self.explode, **kwargs) if self.fadeout <= 0: self.active = False @@ -27,4 +28,5 @@ class Show(pygame.sprite.Group): self.timeout -= dt def sprites(self): - return super().sprites() if self.active else None \ No newline at end of file + """ Return sprites only when active """ + return super().sprites() if self.active else [] \ No newline at end of file -- cgit v1.2.3