Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have developed an iso engine for a farm game. In general it works fine, but the problem is that it is not always accurate when pressing the tiles, so the tile I wanted to select is not the one picked. Anybody has some ideas how to improve this?

share|improve this question
1  
You should at least provide some code that shows what you're currently doing so that people can tell you how to improve on it. –  Tetrad Feb 14 '12 at 16:50
add comment

2 Answers

In this answer the ratio between the projected diagonal of a square laying on the ground are 70:30. You can generalize with ease for the particular perspective you are using.

share|improve this answer
add comment

You should use a transform matrix. Check out this tutorial: http://www.alcove-games.com/isometric_tile_picking.php

share|improve this answer
    
Could you provide a few paragraphs on what a transform matrix is? Link-only answers are highly discouraged on the Stack Exchange network. –  Manishearth Dec 2 '12 at 2:24
    
ok basically what we're trying to do is creating a transform matrix that will match the isometric world. So then, when looking up for coordinates of your isometric tiles, all you have to do is vector v = inv(transformMatrix) * vector u. Your game camera is in fact a transform matrix. It just is very basic (identity matrix scaled by some factor). The transform matrix for an iso world is a bit trickier (rotation by 45 degree, scaling, translation) but there is nothing that is really complicated. Hope this helps! –  Tony Dec 2 '12 at 3:50
    
Oh, I have no interest in this post, I was reviewing. I meant for you to add that into your post--it helps prevent link rot. –  Manishearth Dec 2 '12 at 9:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.