diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-20 16:59:13 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-20 16:59:13 +0200 |
commit | 398eebe7829622c6983cb28528f2208b4d596f32 (patch) | |
tree | 411f5d2fa3b7fc8b5352bc3cda49621fbd858919 /src/sliceitoff/screens/levelup.py | |
parent | 191110be33196866998da385fbc3107344d2bf73 (diff) |
text to srites. cache scaled font sprites...
Diffstat (limited to 'src/sliceitoff/screens/levelup.py')
-rw-r--r-- | src/sliceitoff/screens/levelup.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sliceitoff/screens/levelup.py b/src/sliceitoff/screens/levelup.py new file mode 100644 index 0000000..178160c --- /dev/null +++ b/src/sliceitoff/screens/levelup.py @@ -0,0 +1,27 @@ +import os +import pygame + +from display import Scaling +from images import Images, Fonts +from stats import Stats + +class Status(): + def __init__(self): + self.sprites = pygame.sprite.Group() + + def update(self, dt): + """ Update sprites basis of dt. dt = milliseconds from last update """ + + score_str = ( + "{:02d}\x12 {:02d}\xfe {:02d}\x03 " + "{:02d}\x0e {:08d}\x0f").format( + Stats.level, + 99 if Stats.percent == 100 else int(Stats.percent), + Stats.lives, + Stats.bonus // 1000, + Stats.score) + self.sprites = TextGroup( + score_str, + (0, 282_000), + size = 16_000, + font = '8x8') |