straight to diagonal mapping

Started by
0 comments, last by plugwatson 21 years, 3 months ago
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?
Advertisement
I worked it out, not worth posting it''s so easy!

This topic is closed to new replies.

Advertisement