Game - Map data structures
Sam Holden
sholden at flexal.cs.usyd.edu.au
Fri Jun 18 21:42:53 EDT 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