summaryrefslogtreecommitdiff
path: root/src/sliceitoff/player/player.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-30 13:58:02 +0200
committerViljami Ilola <+@hix.fi>2024-03-30 13:58:02 +0200
commit5874005e58d0f26b4393845b3b18160658ece160 (patch)
tree428f315dbd99e3f77677107586cac493d000cac7 /src/sliceitoff/player/player.py
parentacfac65f17a274d6d7f73cb44ed9476032241134 (diff)
refactor game.level
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r--src/sliceitoff/player/player.py9
1 files changed, 5 insertions, 4 deletions
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 """