Answers for "[Puzzle Game]Finding Combination of squares in a 2D Grid"
http://answers.unity.com/questions/1714094/puzzle-gamefinding-combination-of-squares-in-a-2d.html
The latest answers for the question "[Puzzle Game]Finding Combination of squares in a 2D Grid"Answer by Bunny83
http://answers.unity.com/answers/1714159/view.html
So you want to find 2x2 squares which are made of the same color and allow overlaps? Since you want allow overlaps you just have to do a scan and mark procedure. Just iterate through all of your tiles. For each tile you compare it to the tile x+1 , also the tile y+1 and finally x+1 and y+1. If they are all the same just mark those 4 tiles for removal. If you do that for every tile you get all tiles marked which are part of a 2x2 square. Watch out to stay in bound when doing "+1" in any direction. The last column doesn't need to be checked since the tiles in the second last column would check them implicitly.Fri, 03 Apr 2020 13:54:28 GMTBunny83