Mercurial > pygame-tutorial-slides
changeset 131:8b3f7438b17a
created
| author | Radomir Dopieralski |
|---|---|
| date | Mon, 18 Jun 2012 20:20:10 +0200 |
| parents | 7018a4282316 |
| children | cbfbaa153991 |
| files | docs/003%2F002.py |
| diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/003%2F002.py Mon Jun 18 20:20:10 2012 +0200 @@ -0,0 +1,7 @@ +class HeroSprite(pygame.sprite.Sprite): + def animation_slide(self, (dx, dy)): + facing = FACING[dx, dy] + self.image = self.spritesheet[facing] + for step in xrange(8): + self.rect.move_ip(dx * 4, dy * 4) + yield
