This commit is contained in:
Bowske 2020-04-03 17:41:25 +02:00
commit ec587f3bf3

View File

@ -40,31 +40,35 @@ class Smieciarka(pygame.sprite.Sprite):
self.w_dol()
def w_lewo(self):
if self.x > 0 or game.plansza[self.x - 1, self.y].jestPrzeszkoda is not True:
self.x -= 1
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
if self.ruch == 2:
self.image = pygame.image.load(
'resources/plansza/smieciarka.png')
self.ruch = 1
if self.x > 0:
if game.plansza[self.x - 1, self.y].jestPrzeszkoda is not True:
self.x -= 1
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
if self.ruch == 2:
self.image = pygame.image.load(
'resources/plansza/smieciarka.png')
self.ruch = 1
def w_prawo(self):
if self.x < 14 or game.plansza[self.x + 1, self.y].jestPrzeszkoda is not True:
self.x += 1
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
if self.ruch == 1:
self.image = pygame.transform.flip(self.image, True, False)
self.ruch = 2
if self.x < 14:
if game.plansza[self.x + 1, self.y].jestPrzeszkoda is not True:
self.x += 1
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
if self.ruch == 1:
self.image = pygame.transform.flip(self.image, True, False)
self.ruch = 2
def w_gore(self):
if self.y > 0 or game.plansza[self.x, self.y - 1].jestPrzeszkoda is not True:
self.y -= 1
self.rect.y = self.y * HEIGHT + self.y * MARGIN
if self.y > 0:
if game.plansza[self.x, self.y - 1].jestPrzeszkoda is not True:
self.y -= 1
self.rect.y = self.y * HEIGHT + self.y * MARGIN
def w_dol(self):
if self.y < 14 or game.plansza[self.x, self.y + 1].jestPrzeszkoda is not True:
self.y += 1
self.rect.y = self.y * HEIGHT + self.y * MARGIN
if self.y < 14:
if game.plansza[self.x, self.y + 1].jestPrzeszkoda is not True:
self.y += 1
self.rect.y = self.y * HEIGHT + self.y * MARGIN
class Dom(pygame.sprite.Sprite):