Best algorithm for recursive adjacent tiles?
- by OhMrBigshot
In my game I have a set of tiles placed in a 2D array marked by their Xs and Zs ([1,1],[1,2], etc).
Now, I want a sort of "Paint Bucket" mechanism: Selecting a tile will destroy all adjacent tiles until a condition stops it, let's say, if it hits an object with hasFlag.
Here's what I have so far, I'm sure it's pretty bad, it also freezes…