[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Animated sprites
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Animated sprites
- From: Rene Dudfield <renesd@xxxxxxxxx>
- Date: Sun, 7 Aug 2005 18:17:18 +1000
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 07 Aug 2005 04:17:30 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DncBN3UJkZSMg9v96jrUdgbYzAVY2sjBiFV40n0vlH6jtoIJr41znX+399BmdxmN6WKouQHXu02Ar/yvjOk/F+wZM3f6FObPFghx6ouB2XqY25W1gpXdR5NVYncOT1/0EkNrIdQUP/0VRDuwDdpgu3yBen6MFgPnIToJcook8AE=
- In-reply-to: <1122572867.1900.25.camel@localhost.localdomain>
- References: <1122572867.1900.25.camel@localhost.localdomain>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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"
>
>
>