Demo of a walking directional sprite animation
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .flake8 | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| sara-walking.gif | ||
| sara.py | ||
| SaraFullSheet.png | ||
pygame-sara-walking
Demo of a walking directional sprite animation as answer to a question on the pygame reddit.
The pygame.sprite.Sprite class makes use of two attributes, rect and image.
Changing the attribute image to a @property function, the class can select different sprites on its current state (direction, phase in animation, ...).
Below short demonstration shows a cycle of 6 animation steps for the 4 directions nort, south, east, west.
Attributions
Since I'm no artist, the sprite is Sara, the logo of opengameart.org, downloaded from here:
https://opengameart.org/content/lpc-sara
This sheet of Sara is created by Stephen "Redshrike" Challener, submitted by William.Thompsonj. Original Sara by Mandi Paugh as mascott for https://opengamearts.org
