# Plot isometric tiles ?

This topic is 3330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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! :)

##### Share on other sites
the matrix I've calculated is
[ 1   ,  1 ][-1/2 , 1/2]

aka
x = x+y
y = (y-x)/2

this will rotate your map 45deg CW

##### Share on other sites
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:

def tileYInPixels(tileRowIndex, tileHeightInPixels) :     return tileRowIndex * (tileHeightInPixels / 2.0)

##### Share on other sites
this is what the matrix will do:

- just prettier :D

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 11
• ### Forum Statistics

• Total Topics
633653
• Total Posts
3013156
×