I have been trying to get a sprite position on the tile grid, but it isnt seeming to work. Can someone please help? I'll attach my code. So far I've only tried columns.

Last updated on Oct-18-2019 Download

I have been trying to get a sprite position on the tile grid, but it isnt seeming to work. Can someone please help? I'll attach my code. So far I've only tried columns.

Simple formulas here...

(Sprite X - Camera X + 4) / 8

(Sprite Y - Camera Y + 4) / 8

Adding 4 is for rounding to nearest.

To divide by 8, shift right 3 times.

If you are talking about full 16x16 metatiles, use 16 instead of 8, and 8 instead of 4.

If you have no scrolling or no camera, your camera is zeroes.

(Sprite X - Camera X + 4) / 8

(Sprite Y - Camera Y + 4) / 8

Adding 4 is for rounding to nearest.

To divide by 8, shift right 3 times.

If you are talking about full 16x16 metatiles, use 16 instead of 8, and 8 instead of 4.

If you have no scrolling or no camera, your camera is zeroes.