Oof, it's been a while since I've asked for help twice in one day xD
So I'm working on a treasure hunt game, it's sort of a reverse minesweeper where you have limited shovels to dig and find treasure with. The grid of tiles is made using sprites. I have some special items to dig up, but otherwise the tile just spawns text that says how many squares away the chest is, and also it changes to red if it's adjacent to a kill tile.
The issue is, sometimes it's not entirely accurate? The numbers will be off by 1 or 2, and sometimes I'll have a full 3x3 grid of red tiles but no skulls around.
So I'm assuming it has something to do with my distance formula. Currently I'm using:
str((floor(distance(Tile.X,Tile.Y,Treasure.X,Treasure.Y)/32)))
I had the floor set to int before, but either one has slightly inaccurate results.
Thanks so much!