Simple question I have here.
Say my tile map is based on 32x32 tiles for an 800x600 image so let's say 25 tiles across and 19 down.
So now I have that cell 0 of any row contains the first 0-31 pixels, cell 1 contains then 32nd-63rd pixels, cell 2 has 64-96 pixels and so on. If I have my player somewhere and now I want to get the corresponding tile, what can I do? I can't just divide by 32 as this doesn't always work such as here:
Let's say I am testing both 64 and 96 in the x direction and am testing against the range of 64-96 (which should be in cell 2 of any row)
64/32 = 2 (this is the correct column for my tile map for any row) 96/32 = 3 (incorrect, the 96th pixel is still within column 2 for any row of the tile map)