[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Animated sprites



Using Python imaging library(PIL) you can load gif, and fli/flc image sequences.

Then you can use the frombuffer() method to create surfaces from the
PIL ones pretty quickly.

These formats store animations pretty small for 8 bit images.

Another option is to use pymedia to store the animations as a movie,
and play them back.

I haven't tried any of those approaches... so I'm not positive how
well they'd work.  Please let me know if anyone tries them! :)



On 7/29/05, Dan <dan@xxxxxxxxxxxxxxxx> wrote:
> Does anyone have a recommended way of making animated sprites?
> 
> I read the source code to SolarWolf and saw the way Pete Shinners does
> it, which is pretty much what you would expect: load a list of images
> and blit them in sequence. (I also noticed his animstrip() function,
> which cleverly cuts a single long image into multiple small ones. Good
> thinking, Pete!)
> 
> Since Pete is certainly an expert on pygame, I would guess that there's
> no better way of doing it. But I thought I would ask if anyone has any
> other suggestions.
> 
> --
>  The first time the [artificially intelligent] creature was put down
>  in the game world, he just stared at his feet. I was puzzled, but
>  after debugging found that the creature was trying to eat himself.
>  He was hungry, and had spotted himself as a nearby convenient object!
>      - Richard Evans, creator of the AI game "Black & White"
> 
> 
>