On Sat, Mar 6, 2010 at 11:44 AM, Kris Schnee 
<kschnee@xxxxxxxxxx> wrote:
On 3/5/2010 10:40 AM, René Dudfield wrote:
However, sometimes we would like to operate on a whole bunch of
smaller surfaces stuck together.
I did something very similar with Gummworld. The supersurface was not a single Pygame surface, rather a virtual surface made of a 2D array of sprites each with its own image. The Pygame drawing surface was the visible display; only I found that Group.draw()-ing all the terrain sprites and allowing Pygame to automatically crop them was in larger cases more efficient than cropping the drawing scope in Python. Still, it did indeed waste memory having all those sprites, each with their own image, outside the display area. The level design was rectangular, and if the map is irregular then large portions of the supersurface could possibly have many unused sprites; which led to a crude sparse map implementation, where an array cell with a None value would be ignored. It's a simple paradigm in which the special cases tend to center around conserving memory and CPU.