diff --git a/game.py b/game.py index 84577f2..34996c8 100644 --- a/game.py +++ b/game.py @@ -7,6 +7,7 @@ class Smieciarka(pygame.sprite.Sprite): self.x = x self.y = y self.image = pygame.image.load('smieciarka.png') + self.ruch = 0 pygame.sprite.Sprite.__init__(self) self.rect = pygame.Rect(self.x * WIDTH + MARGIN * self.x + MARGIN, self.y * HEIGHT + MARGIN * self.y, WIDTH, HEIGHT) @@ -15,13 +16,17 @@ class Smieciarka(pygame.sprite.Sprite): if self.x > 0: self.x -= 1 self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN - self.image = pygame.image.load('smieciarka.png') + if self.ruch == 2: + self.image = pygame.image.load('smieciarka.png') + self.ruch = 1 def w_prawo(self): if self.x < 14: self.x += 1 self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN - self.image = pygame.image.load('smieciarka_odwrocona.png') + if self.ruch == 1: + self.image = pygame.transform.flip(smieciarka.image, True, False) + self.ruch = 2 def w_gore(self): if self.y > 0: