But the way I usualy do it is simply by drawing one layer on top of the other like:
Code: Select all
int map[2][32][32];
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
for (int l = 0; l < layers; l++)
{
drawTile(x, y, map[l][x][y]);
}
}
}
The one thing I have learned about recently is a z-layer, which is like a tile based depth-buffer.
This is used in games like Chrono Trigger and I think in Elysian Shadows.
In this layer you can have a layer 1, layer 2, transition tile and a neutral tile.
To move between these tiles you use transition tiles like stairs which have info about the z-coordinate you move to.
A neutral tile is used for ridges or bridges.
It is also used for deciding where a sprite is drawn.
I tried messing around in Temporal Flux (Chrono Trigger Editor) but it was slightly confusing because of the layout of the editor.
The problem is that I have only a vague idea of how to implement this but it would be nice I could see some actual code or just get more info about it.
Also, when iterating through a three-dimensional array, what would be the most suitable order for a row-major language like C?
Any feedback will be greatly appreciated