Archived

This topic is now archived and is closed to further replies.

plugwatson

straight to diagonal mapping

Recommended Posts

Hi everyone! Please could someone tell me how to convert from a standard map array... 1000 by 1000 maparray[1000000] to a diagonal arry from which the isometric game is viewed isometricarray[200] so far my code looks a bit like this on chooseareaofmap(themaploc,themap) global tilesacross global tilesdown global gmapwidth global gmapheight global visualmap rows = tilesdown * 2 -- first reference in the global map visualmap[1] = themap[themaploc[2]*1000+themaploc[1]] yy = 1 xx = 1 rowswitch = 1 visualmapcounter = 2 repeat while yy <=rows repeat while xx <=tilesacross if rowswitch = 1 then visualmap[visualmapcounter] = themap[((themaploc[2]-yy)*1000-xx)+(themaploc[1]-xx)] else visualmap[visualmapcounter] = themap[((themaploc[2]-yy)*1000-xx)+(themaploc[1]-xx)] end if visualmapcounter = visualmapcounter + 1 xx = xx + 1 end repeat if rowswitch = 0 then rowswitch = 1 else rowswitch = 0 end if xx= 1 yy = yy + 1 end repeat end This is a really tough one that may set me back to the drawing board! if you can''t decipher the code do you know anywhere I can find this code?

Share this post


Link to post
Share on other sites