Re: [pygame] Good code

2007-12-07 Thread Marius Gedminas
On Thu, Dec 06, 2007 at 05:52:59PM +0100, Mundial 82 wrote: Thanks to all your help, my little newbie project is shaping up. So now I have a different question: being a non-programmer, I like to learn by reading other people's code when it is available. I find it difficult, though, to

Re: [pygame] Animated GIFs

2007-12-07 Thread Ian Mallett
On 12/7/07, DR0ID [EMAIL PROTECTED] wrote: One solution would be to split the animated gif into single images and use them to make an animation. There's some good examples on pygame.org. For example, I know that one of my programs, Asteroids, has several animations done this way. Ian

Re: [pygame] Animated GIFs

2007-12-07 Thread DR0ID
Hello As far as I can remember pygame does not support animated gifs. One solution would be to split the animated gif into single images and use them to make an animation. ~DR0ID 110110010 schrieb: How to make an animated GIF be animated please (excuse me for my english, I'm not english

[pygame] Animated GIFs

2007-12-07 Thread 110110010
How to make an animated GIF be animated please (excuse me for my english, I'm not english or american)

Re: [pygame] Animated GIFs

2007-12-07 Thread Dan Krol
What about a 24bit color lossless animated image file? (MNG?) I could see how an animated gif would be useful because of available editing utilities, but it would be nice if there were something like that for Pngs.

Re: [pygame] Animated GIFs

2007-12-07 Thread Ian Mallett
Cool! I've always been saving the pictures separately in a folder. Ian

[pygame] Game Framework

2007-12-07 Thread Kris Schnee
While working on a self-teaching project, I came up with a better way to organize game states and events than what I'd been doing, with some help from the GameDev forums. The code at: http://kschnee.xepher.net/code/framework.py.txt shows the new framework code, in a demo that displays a

Re: [pygame] Animated GIFs

2007-12-07 Thread Greg Ewing
Ian Mallett wrote: Cool! I've always been saving the pictures separately in a folder. Ian Another possibility would be to put them in a zip file and use the zipfile module to extract them. Then you can use other image formats such as jpg or png if you want. -- Greg

Re: [pygame] Animated GIFs

2007-12-07 Thread Casey Duncan
I think you will need to use PIL to break the animated gif into separate images (in memory), then create pygame surfaces from them. This may help (looks like you can use seek() to get at the separate images): http://www.pythonware.com/library/pil/handbook/format-gif.htm -Casey On Dec 7,

Re: [pygame] Game Framework

2007-12-07 Thread Richard Jones
On Sat, 8 Dec 2007, Kris Schnee wrote: This code does nothing, but does it elegantly. If only there was QOTW for pygame list :) Richard

Re: [pygame] Animated GIFs

2007-12-07 Thread David Gowers
Hi, On Dec 8, 2007 10:00 AM, Ian Mallett [EMAIL PROTECTED] wrote: Like for alpha channels? Try saving .png s in a folder. I don't think there's a way to do it with PIL in one file. You could always make a GIMP file plugin that takes an image with a frame per layer (as you get when loading

Re: [pygame] Animated GIFs

2007-12-07 Thread Ian Mallett
Like for alpha channels? Try saving .png s in a folder. I don't think there's a way to do it with PIL in one file.

Re: [pygame] Good code

2007-12-07 Thread Greg Ewing
Ian Mallett wrote: When writing code, it is good to have comments, but it is not usually wise to put them in until you've tested the relevant code. Although sometimes it can be helpful to write a comment beforehand as a sort of mini design document, to help clarify your thoughts about what the

Re: [pygame] Good code

2007-12-07 Thread Ian Mallett
When writing code, it is good to have comments, but it is not usually wise to put them in until you've tested the relevant code. E.g., you wouldn't want to write some code, then a bunch of comments about it, then find that your method is useless, so the comments are useless too. Also, try to