Some help would be very welcome guys !
I've written this tile engine thingy, that extracts the tile at the screen coords by dividing the x and y coords by the tile size.
Seems to work ok, but I'd like to extract the remainder from it.. (to use as as offset)
for example.. my routine brings back X = 3.567
Yes, I use the 3 to find the map tile, but I'd also like to use 5 to tell me how many pixels it is into the tile. (So I can check for collisions within the tile)
Problem is, the tiles are 64 x 64 - so I cant just strip out to 1 decimal place. :(
Any Advice please !.
I've written this tile engine thingy, that extracts the tile at the screen coords by dividing the x and y coords by the tile size.
Seems to work ok, but I'd like to extract the remainder from it.. (to use as as offset)
for example.. my routine brings back X = 3.567
Yes, I use the 3 to find the map tile, but I'd also like to use 5 to tell me how many pixels it is into the tile. (So I can check for collisions within the tile)
Problem is, the tiles are 64 x 64 - so I cant just strip out to 1 decimal place. :(
Any Advice please !.