diff --git a/__pycache__/sprites.cpython-37.pyc b/__pycache__/sprites.cpython-37.pyc index 435c9dc..26701dc 100644 Binary files a/__pycache__/sprites.cpython-37.pyc and b/__pycache__/sprites.cpython-37.pyc differ diff --git a/data/graphics/a.txt b/data/graphics/a.txt deleted file mode 100644 index e69de29..0000000 diff --git a/data/graphics/asd.png b/data/graphics/asd.png index f3cb7d1..94f214b 100644 Binary files a/data/graphics/asd.png and b/data/graphics/asd.png differ diff --git a/data/graphics/qwe.png b/data/graphics/qwe.png index 31c606d..daf57cd 100644 Binary files a/data/graphics/qwe.png and b/data/graphics/qwe.png differ diff --git a/mygame.py b/mygame.py index ad2976a..2f1635d 100644 --- a/mygame.py +++ b/mygame.py @@ -20,8 +20,8 @@ clock=pygame.time.Clock() # initialize two players -events.players.append(Player('asd', 50, 50, 5)) -events.players.append(Player('qwe', 100, 100, 5)) +events.players.append(Player('asd', 400, 100, 5)) +events.players.append(Player('qwe', 400, 500, 5)) all_sprites.add(events.players) events.running=True diff --git a/sprites.py b/sprites.py index cdf30a0..317cc50 100644 --- a/sprites.py +++ b/sprites.py @@ -41,21 +41,29 @@ class Player(pygame.sprite.Sprite): self.colliding=False def moveup(self): + if self.facing!=0: + self.image=pygame.transform.rotate(self.image, (self.facing*90)) self.facing=0 self.acc.y=-1.5 self.acc.x=0 def movedown(self): + if self.facing!=2: + self.image=pygame.transform.rotate(self.image, (self.facing*90)) self.facing=2 self.acc.y=1.5 self.acc.x=0 def moveright(self): + if self.facing!=1: + self.image=pygame.transform.rotate(self.image, (self.facing*90)) self.facing=1 self.acc.x=1.5 self.acc.y=0 def moveleft(self): + if self.facing!=3: + self.image=pygame.transform.rotate(self.image, (self.facing*90)) self.facing=3 self.acc.x=-1.5 self.acc.y=0