obracanie smieciarki
This commit is contained in:
parent
ba52a72fd9
commit
c31ba95788
7
game.py
7
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
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user