Hi all!
I am trying to write a script that loops through all the tiles across the x and y axis , attempting to find a particular tile, and I'm trying to make this script reusable for multiple tilemaps. The way I had approached it was by making a for loop where the start index is 0 and the end index is the width of the tilemap/32 (ending with a result that steps through each tile one by one), then creating a local variable that increments with each loop. While this works, I suppose it also means that when drawing the tile maps, I have to be very precise about the size, which is a bit of a tall order for the particular project I'm on as that would mean going back and tweaking the width and height of a lot of preexisting tilemaps. I was wondering if there was a simpler solution to do this involving some sort of attribute that already does this for me?
Thanks all