Game - Map data structures

Sam Holden sholden at flexal.cs.usyd.edu.au
Sat Jun 19 03:42:53 CEST 2004


On Fri, 18 Jun 2004 22:58:45 +0200,
	Pierre-Frédéric Caillaud <peufeu at free.fr> wrote:
> 
> 	Save memory by having all the water tiles pointing to the same water  
> instance.
> 
> water = WaterTile()
> 
> ... build your tiles :
> 
> if tile should be water:
> 	tile[x][y] = water			# doesn't instanciate
> else:
> 	tile[x][y] = GroundTile()		# instanciate new object

That's going to make it really hard to determine which boats are on a
given water tile.

-- 
Sam Holden



More information about the Python-list mailing list