Perhaps if you are using an array you could add an extra dimension to the array "MapData(X,Y,Layer)". The 'Layer' elements of the array would hold a number of things like this for instance:
MapData(x,y,0) -> this holds the tiles in much the same way as you are currently doing
MapData(x,y,1) -> this holds the ID number or handle of the 'creature'/'building' etc that is within that tile. Then you simply use a similar technique to what you have above to draw the building/creature.
However - using the method I've just given you will only allow you to have one object per tile which is most likely not what you want. Instead you could do this:
MapData(x,y,1) -> this holds the handle to a 'bank' containing a list of handles of objects within that tile. You then just have to remember to update the bank and the array whenever a creature/building moves from one tile to the next.
Hope that is of some help.
MapData(x,y,0) -> this holds the tiles in much the same way as you are currently doing
MapData(x,y,1) -> this holds the ID number or handle of the 'creature'/'building' etc that is within that tile. Then you simply use a similar technique to what you have above to draw the building/creature.
However - using the method I've just given you will only allow you to have one object per tile which is most likely not what you want. Instead you could do this:
MapData(x,y,1) -> this holds the handle to a 'bank' containing a list of handles of objects within that tile. You then just have to remember to update the bank and the array whenever a creature/building moves from one tile to the next.
Hope that is of some help.