So I posted the source of what I have so far. The map is a 2D array of characters, (well a list of lists of characters... anyway) which I know isn't good, but it works *for now*.
Anyway, I'm thinking of implementing a (the?) DungeonCell class, which would just be the container which holds every bit of info about each 'cell' in the dungeon. So, the class would basically have this:
x & y are the coords of that cell
terrain_id is the key to a structure holding information on the terrain for that spot, easy enough.
flags is just that, flags which say if that cell is lit up, been lit up, trap border, etc.
Items is a list of items in that particular cell, if any
monster is the monster currently in that cell, if any
There would be a Dungeon class which holds the cells and such. Any thoughts or suggestions? Thanks for any input
Anyway, I'm thinking of implementing a (the?) DungeonCell class, which would just be the container which holds every bit of info about each 'cell' in the dungeon. So, the class would basically have this:
Code:
class DungeonCell(object): def __init__(self, x, y, terrain_id, flags): self._x = x self._y = y self._terrain_id = terrain_id self._flags = flags self._items = [] self._monster = None
terrain_id is the key to a structure holding information on the terrain for that spot, easy enough.
flags is just that, flags which say if that cell is lit up, been lit up, trap border, etc.
Items is a list of items in that particular cell, if any
monster is the monster currently in that cell, if any
There would be a Dungeon class which holds the cells and such. Any thoughts or suggestions? Thanks for any input
Comment