diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-16 12:35:07 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-16 12:35:07 +0200 |
commit | a23b6647b0ca2cd9f2ccbbe12360c3fa0f96a554 (patch) | |
tree | bab154622f9767fd340278ab275babb76fc569d5 /src/sliceitoff/status | |
parent | 1ad8357f0039292b929e66cf703b4314660aded2 (diff) |
scaling as class
Diffstat (limited to 'src/sliceitoff/status')
-rw-r--r-- | src/sliceitoff/status/status.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/sliceitoff/status/status.py b/src/sliceitoff/status/status.py index afff7f7..ed36711 100644 --- a/src/sliceitoff/status/status.py +++ b/src/sliceitoff/status/status.py @@ -5,15 +5,14 @@ from display import Scaling from images import images class LetterSprite(pygame.sprite.Sprite): - def __init__(self, image, x, y): + def __init__(self, image, pos): super().__init__() self.image = image - self.rect = self.image.get_rect().move(x,y) + self.rect = self.image.get_rect().move(pos) class Status(): - def __init__(self, scaling: Scaling = None): - self.scaling = scaling if scaling else Scaling(50,0,0) + def __init__(self): self.score = 6234823999 self.health = 3 self.updated = True @@ -27,8 +26,7 @@ class Status(): for letter, x in zip(score_str, range(30000,40000,1000)): self.sprites.add(LetterSprite( images[f"letter_{letter}"], - x*self.scaling.scale+self.scaling.left, - y*self.scaling.scale+self.scaling.top)) + Scaling.scale_coordinates((x,y)) )) self.updated = False def add_score(self, score_to_add): |