From f894c2fd09ed17540c49cb4083573861ded76554 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Thu, 28 Mar 2024 22:28:45 +0200 Subject: Show as sprite group with update --- src/sliceitoff/text/text.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sliceitoff/text/text.py') diff --git a/src/sliceitoff/text/text.py b/src/sliceitoff/text/text.py index 8c13004..da48f6c 100644 --- a/src/sliceitoff/text/text.py +++ b/src/sliceitoff/text/text.py @@ -15,11 +15,11 @@ class LetterSprite(pygame.sprite.Sprite): Scaling.factor * (1_000 - randrange(2_000)), Scaling.factor * (1_000 - randrange(2_000))) - def update(self, explode = 0, **kwargs): - if explode: + def update(self, dt = 0, explode = 0, **kwargs): + if explode and dt: self.rect = pygame.Rect( - self.rect.x + self.direction[0] * explode, - self.rect.y + self.direction[1] * explode, + self.rect.x + self.direction[0] * dt, + self.rect.y + self.direction[1] * dt, self.rect.w, self.rect.h) self.direction = ( -- cgit v1.2.3