ok, so, i have a digging game. like dungeon keeper.
imps break 3d blocks. and i want them to then go claim the ground once the block has been destroyed. (they can already dig)
i used a tile map. with all the different floors and room floors. Right now, there are 3 floor types:
ground, ground that can be claimed, and claimed floor.
i have made it so only ground next to a claimed floor can be claimed, once claimed, the surrounding "ground" tiles become "ground that can be claimed" tiles (simple code. just on click change tile at x,y+1 etc)
as any pattern can be cut from the rock, making the tilemap reactive. i will never specifically know which tile where is "ground ready to be claimed". (or.. maybe i can?..there isnt an option for "for each" tile. only "for each" tilemap)
i half thought about running a loop to check each tile. but, that wont get me the nearest.
i suppose... the imp will always be on a certain tile... so i could reference its x,y to the tilemap... claimable tiles will always be reachable... meh, again i cant pinpoint tiles that have a certain tile.... unless... i have a second tilemap that logs imps location, and have a flood function to check area around the imp... but, i would need a tileset per imp so checks dont overlap.... i .. could maybe just set it as the imps child...but at that point i have spawned in 30 tilemaps... maybe i would be better just spawning in a sprite on "ground that can be claimed" and have the imp go to the nearest sprite
im running with the spawn in a sprite on "claimable tile" atm. then imps go to the sprite, start work and hoping the tile at imps location changes instead of using an on click event.
hope this elaboration helps lol.. hope you can see my train of thought on ideas, and any input or suggestions you have would be appreciated!