From 5874005e58d0f26b4393845b3b18160658ece160 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 30 Mar 2024 13:58:02 +0200 Subject: refactor game.level --- src/sliceitoff/player/player.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sliceitoff/player/player.py') diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py index 0103a81..72c5b2f 100644 --- a/src/sliceitoff/player/player.py +++ b/src/sliceitoff/player/player.py @@ -13,8 +13,9 @@ class PlayerSprite(pygame.sprite.Sprite): super().__init__() self.image = image self.rect = self.image.get_rect() - - def update(self, pos = None, **kwargs): + + def update(self, pos = None): + """ Sets sprite center at given position """ if pos: w, h = self.image.get_size() self.rect = self.image.get_rect().move(pos[0]-w//2,pos[1]-h//2) @@ -49,8 +50,8 @@ class Player(pygame.sprite.Group): self.direction = not self.direction if pos: self.position = Scaling.scale_to_internal(pos) - for sprite in super().sprites(): - sprite.update(pos = pos) + for sprite in super().sprites(): + sprite.update(pos = pos) def sprites(self): """ Only list sprite of current direction for draw """ -- cgit v1.2.3