diff --git a/classes/minesweeper.py b/classes/minesweeper.py index ce50e12..1bee22e 100644 --- a/classes/minesweeper.py +++ b/classes/minesweeper.py @@ -45,24 +45,21 @@ class Minesweeper: self.update_offset(delta) def move(self, dir:int): - #południe + #południe - 0 + #wschód - 90 + #północ - 180 + #zachód - 270 + self.rotated_image = pygame.transform.rotate(self.image, dir) if dir==0: - self.rotated_image = pygame.transform.rotate(self.image, 0) self.position_y+=1 self.offset_y=-self.size - #północ - elif dir==1: - self.rotated_image = pygame.transform.rotate(self.image, 180) + elif dir==180: self.position_y-=1 self.offset_y=self.size - #zachód - elif dir==2: - self.rotated_image = pygame.transform.rotate(self.image, 270) + elif dir==270: self.position_x-=1 self.offset_x=self.size - #wschód - elif dir==3: - self.rotated_image = pygame.transform.rotate(self.image, 90) + elif dir==90: self.position_x+=1 self.offset_x=-self.size diff --git a/main.py b/main.py index 3e32f1f..595657f 100644 --- a/main.py +++ b/main.py @@ -34,11 +34,11 @@ def main(): if keys[pygame.K_DOWN] and not_moving: map.minesweeper.move(0) elif keys[pygame.K_UP] and not_moving: - map.minesweeper.move(1) + map.minesweeper.move(180) elif keys[pygame.K_LEFT] and not_moving: - map.minesweeper.move(2) + map.minesweeper.move(270) elif keys[pygame.K_RIGHT] and not_moving: - map.minesweeper.move(3) + map.minesweeper.move(90) #narysowanie terenu i obiektów