The last days, I have been trying to create an algorithm that detects the tile the cursor is on.
I am close to figure it out, but cant manage to get the last piece.
Here is a picture of everything.
32(X) by 16(Y) tileset (top right) with the red dot being 0,0 coordinates & code at bottom:
Right now, when i run my code, the light tiles are selected well, but the dark ones only the top left and bottom right part of them are selected well, while the other half of them counts as if they’re light tiles (top left picture).
If any of you know how i could fix this please tell!!!
Also, if i am overcomplicating myself and there is another way, please tell me too! ^^
Thanks a lot!