Oh noes! It's math time again
I'd like some help to replace the inefficient hacks I'm using to see if a point is inside an isometric tile.
I'm currently looping trough every tile to check if the point is inside it's bounding box.
If it is I do a check between the tile's mask and a pixel at the place's point to check if the point is actually inside the tile.
This is the code I use to calculate the place where my tiles must be displayed on the screen.
x = ((tile.width/2)*rowx+((tile.width/2)*rowy))
y = ((tile.height*4)+((tile.height/2)*rowy)-((tile.height/2)*rowx)) + (300-tile.eight*1.5)
I've also looked around a bit to see how other people fixed their math isometric problem but most of their solutions were above me.
One option I heard of was using matrices to rotate the tiles so that they form squares and can be used fully in a isinRect check.
Though I have no idea how to do that.
So anyone have any advice?