Diamond Map Confusion

Started by
1 comment, last by gorgar 23 years, 10 months ago
I''ve read most of the iso. tutorials on gamedev, but I''m still badly confused by the relationship between your 2D map array and the drawing process on screen, specifically with the diamond map style, as opposed to stagged or slide maps. I want to maintain a 2D array for my world, and offset into that array to determine the current set of visible tiles for drawing in my map window. So, I obviously need to know how many tiles my map window can display both horizontally and vertically. But, do I assume that the current world position corresponds to the top-left or centre of my map window. More so I am confused as to what happens to drawing at the edges of the map. I''m clear on the coordinate system (0,0 is the middle left of the map etc), and the draw order (diagonal strips, top to bottom). Any help appreciated. I''d appreciate some help here
Advertisement
unfortunately, with a diamond map that is larger than the screen, you can''t just specify an x range and a y range.

instead, if you want to blit the minimum of tiles, you have to set it up to blit horizontal rows.

you take your mousemap (or whatever device you use to map screen coordinates to map coordinates) and determine which mouse map the upper left corner of the screen is in (not the tile... the mouse map)

now, you do the same thing for the upper right corner.

for the upper left corner, take the map tile that is in the upper-left corner of the map, and for the right corner, the upper right corner of the map. this will specify a row that needs to be blitted. you''ll have to walk from the left to the right.

when you are done with that row, you move one tile southeast from the upper left, and one tile southwest from the upper right, and do the same thing

next, you move southwest from the left, and southeast from the right, and do it again.

you zig-zag in this manner until you have written all of the rows that will fit in the viewing area.
the previous post was mine. i think i mistyped my pwd.

Get off my lawn!

This topic is closed to new replies.

Advertisement