From c31ba957886a6349ad089ef3dae6983ad9d9dd8d Mon Sep 17 00:00:00 2001 From: s444349 Date: Sun, 29 Mar 2020 13:04:58 +0200 Subject: [PATCH] obracanie smieciarki --- game.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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: