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

Re: [pygame] Big Scrolling Surfaces



Rene Dudfield wrote:
Are you reusing surfaces in any of these? Or is each tile unique?

Each "zone" is a 2D list of tile numbers, each of which refers to a piece of a single "tileset" image. So for instance, a sea is a large number of identical water tiles. I managed to get an automatic tileset loader that figures out how many 64x64 tiles fit in an image and gets a list of clipping rectangles for them all.


As long as you don't use up the real memory of your user it should be
fine. On the other hand you could flip sections onto and off of the HD
as needed just like you do your zones but an outer circle around your
current 9 zones.

I've got something like that -- the list of what tile goes where is kept in memory for lots of zones, while only the 3x3 zone area around the current zone (ie. what the player can see plus the immediate area) is actually drawn. I might trim that to half a zone on either side instead of a full zone, but you're right -- modifying the system further is probably not necessary.


Kris