Breaking tiles away from a TileMap

BlitzMax Forums/BlitzMax Programming/Breaking tiles away from a TileMap

VomitOnLino(Posted 2006) [#1]
Hello Blitz Community,

this is my first post and I hope that my question hasn't been asked before - I searched but it turned out to be nothing that I need.

Well my problem is this:
I have a playfield stored in a 2D array array(x,y), the array is true if there is a tile on that space. Now I want to randomly remove tiles from the field with each move (tick). (See Illustration below)

So far so good, the black blocks are broken away.

Now I want to detect if there are any redunant squares that have no connecting (in the 4 directions N S W E) to the stage. I tought of flood fill algorithms but I can't get my head around how those work. Also the largest platform must survive but it is not always in the center.

Redunant blocks are colored red, broken away ones black.

Can anyone help me with this major headache of mine ?


smilertoo(Posted 2006) [#2]
just flag then, if a tile isnt touching a white tile then its redundant.


VomitOnLino(Posted 2006) [#3]
I sussed it thank you!