Isometric tile question

Nibbie
Posts: 2
Joined: 2009.08
Post: #1
Hello everyone. I am making an isometric tile based game, and have a question as to implementation. The shape of the tile image I have is basically a diamond (because of the isometric factor), and positioning them together means there's overlapping because of the square UIImageViews that they're displayed in. This obviously creates problems with touch detection. Is there a better way for me to implement the tile-engine? Thanks for reading.
Moderator
Posts: 683
Joined: 2002.11
Post: #2
I've done some pretty fancy iso stuff, but I think the best thing to do for iPhone is to treat each tile as a circle instead of a square, with the circle touching each of the diamond's edges once. That doesn't fit the whole shape perfectly, but I think it will help people not accidentally select the wrong tile.

If you don't do that, you're going to have to figure out triangle collisions.

My web site - Games, music, Python stuff
Member
Posts: 194
Joined: 2009.02
Post: #3
When using 2/1 diamond shaped tiles, you need to leave the bottom row(or top) of pixels empty- So if your tiles are 64x32 pixels, it would really be 64x31 pixels with one totally transparent row of pixels. This will prevent overlapping. There should be no problem with touch detection as long as you convert the initial bounding collision to a pixel value and check the tile's transparency.
Nibbie
Posts: 2
Joined: 2009.08
Post: #4
diordna Wrote:I've done some pretty fancy iso stuff, but I think the best thing to do for iPhone is to treat each tile as a circle instead of a square, with the circle touching each of the diamond's edges once. That doesn't fit the whole shape perfectly, but I think it will help people not accidentally select the wrong tile.

If you don't do that, you're going to have to figure out triangle collisions.

Thanks for your reply. If I could clarify, do you mean that when I'm doing the touch detection, I manually edit the points I'm checking to reflect a circle instead of a square? At the moment, I'm doing the touch just by just comparing the view returned by the touch against all my UIImageViews. Thanks again.