summaryrefslogtreecommitdiff
path: root/src/sliceitoff/player/player.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r--src/sliceitoff/player/player.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py
index de49083..c062f1c 100644
--- a/src/sliceitoff/player/player.py
+++ b/src/sliceitoff/player/player.py
@@ -12,7 +12,7 @@ class PlayerSprite(pygame.sprite.Sprite):
self.image = image
self.rect = self.image.get_rect()
- def update(self, pos = None):
+ def update(self, pos = None, **kwargs):
if pos:
w, h = self.image.get_size()
self.rect = self.image.get_rect().move(pos[0]-w//2,pos[1]-h//2)
@@ -28,11 +28,13 @@ class Player(pygame.sprite.LayeredUpdates):
image = pygame.transform.rotate(image, 90)
self.add(PlayerSprite(image), layer = 1)
- def update(self, pos = None, direction = False, dt = 0):
- if not self.lazer:
- if direction:
- self.direction = not self.direction
- self.switch_layer(0,1)
- if pos:
- super().update(pos = pos)
- self.position = Scaling.scale_to_internal(pos)
+ def update(self, pos = None, direction = False, **kwargs):
+ if self.lazer:
+ direction = False
+ pos = None
+ super().update(pos = pos, **kwargs)
+ if direction:
+ self.direction = not self.direction
+ self.switch_layer(0,1)
+ if pos:
+ self.position = Scaling.scale_to_internal(pos)