Plot isometric tiles ?
Hi!
So I'm working on a game with isometric tiles.
But I can't figure out how to plot the Y coordinate to draw each tile on.
My map is a two-dimensional array.
I use a double for-loop to analyze it and see what kind of tile it should blit.
I know how to plot the X coordinate, but not the Y, at the moment it looks like this: http://img39.imageshack.us/img39/86/gameoh.jpg
The yellow square is my temporarly player...
So how do I do, lol ?
Thank you! :)
the matrix I've calculated is
aka
x = x+y
y = (y-x)/2
this will rotate your map 45deg CW
[ 1 , 1 ][-1/2 , 1/2]
aka
x = x+y
y = (y-x)/2
this will rotate your map 45deg CW
You're close, you just need to overlap the tile rows. If you look at your picture, what you really want is for every other row to be touching at the top and bottom, so the rows in between need to be placed at half-tile position.
Which means you pretty much just do this:
Which means you pretty much just do this:
def tileYInPixels(tileRowIndex, tileHeightInPixels) : return tileRowIndex * (tileHeightInPixels / 2.0)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement