Merge branch 'master' of https://git.wmi.amu.edu.pl/s444350/SZI-Smieciarka into adamB
This commit is contained in:
commit
ec587f3bf3
42
modele.py
42
modele.py
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user