summaryrefslogtreecommitdiff
path: root/src/sliceitoff/text/text.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/text/text.py')
-rw-r--r--src/sliceitoff/text/text.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sliceitoff/text/text.py b/src/sliceitoff/text/text.py
index f01e517..e86bede 100644
--- a/src/sliceitoff/text/text.py
+++ b/src/sliceitoff/text/text.py
@@ -12,8 +12,20 @@ class LetterSprite(pygame.sprite.Sprite):
self.image = image
self.rect = self.image.get_rect().move(pos)
self.direction = (
- Scaling.factor * 40 * 1_000 + randrange(4_000),
- Scaling.factor * 40 * 1_000 + randrange(4_000))
+ Scaling.factor * (2_000 - randrange(4_000)),
+ Scaling.factor * (2_000 - randrange(4_000)))
+
+ def update(self, explode=0):
+ if explode:
+ self.rect = pygame.Rect(
+ self.rect.x + self.direction[0] * explode,
+ self.rect.y + self.direction[1] * explode,
+ self.rect.w,
+ self.rect.h)
+ self.direction = (
+ self.direction[0] * 1.15,
+ self.direction[1] * 1.15)
+
class TextPage(pygame.sprite.Group):
def __init__(