learn Python. Create Games

User Tools

Site Tools


This is an old revision of the document!

step 008 - animation and sprite sheet

Remember the Subsurfaces from the last step ? And remember that the snake had always the same grinning facial expression ? Now, let's make some animated sprites1) - not pygame sprites, but surfaces that show different images of an animation cycle, like a bird flapping it wings.

Instead of painting all the single pictures of an animation cycle myself i prefer to use ready-made sprite sheets. In the data folder, you will find a spritesheet2) from showing several pictures of an animal.

With the help of pygame's subsurface command, i will show you how to extract single images from the sprite sheet and use them.


additional resources

source code

a 2d-object moving around is referred as a Sprite_(computer_graphics)
a graphic file with lot's of sprites
/var/www/horst/ · Last modified: 2014/01/09 11:07 (external edit)