   2D Isometric - Layering Problem
  Illustration of the problem:http://img215.imageshack.us/img215/6218/testcp.pngLez say i have this simple iso map. The middle tile is heighted up, so when the character passes on the back of it its over the character, but when hes over it, its under the character. I have 2 layers, a map (under the character) and a obj layer (over the character), but i cant figure how to work out this logic. The only thing ive tought is, drawing the map differently.This 2 represent arrays that is where the map comes from.http://img706.imageshack.us/img706/155/testyc.pngThe numbers represent the order theyr draw. In the left, the order im actually drawing em, witch is one of the 2 normal ways u read an array. The second is the only way i tought of solving this puzzle, since there would be many characters in the screen (its a 'tactics' game) i cannot depend on only where my character is to check witch layer the sprite should be, so drawing the map this way i could divide the map into 'lines', like a line with tiles 4 5 and 6 in this example, and each like located into a layer, when any sprite moves, it goes to the layer of that line of tiles.  I wish to know if someone have any ideas for this, and how would be the algoritm for reading this array in that order. Please if someone help me out, try using simple words with no complicated terms, im only 12 and english is not my toungue.PS: No "kid go make easy things" plex =]   
  Hi MadHippie.I would say if you draw your map with your 2nd array example, it should work out just fine. For every tile, first draw the ground, then any possible elevations and finally the sprite (dude) on top of it.Or what seems to be the problem with your own suggestion?   ;  thanx for the reply Xood.i cannot think the logic to the 'for' commands to draw the array in that order. And i dont have a max map size limit, so i would need something to create as many bitmaps i would need, for the many layers the map would have (it would be it Y max). How should i do that ? A vector, or maybe a linked struct (struct->next) ? Any tips to the 'for' command and the synthax ?   ;  Lets assume you got a squared level size: ie. 8x8Here is how it could look like in C.int width = 8;int height = 8;// step backwards through the width of the arrayfor(int i=width-1;i&gt;=0;i--){  // trace "down"  int ysteps = width-i;  for(int j=0;j&lt;ysteps;j++)  {    // setup x and y for the current tile    // or your index into the array would be y*w+x    int x = i+j;    int y = j;    Draw_Tile( x, y );  }}Based on your array image, I actually switched X and Y. :-)   