I’m trying to create a board game in the style of Carcassone, where players place tiles on a board. Each tile is divided in two or more colors, so that when you attach tiles you create larger areas of a color. Those areas could span several tiles. Scoring is based on the total size and shape of the area, so that larger areas would score higher.
In Unity each tile is a gameobject with a texture. Under the hood each tile has an ID so that I know what colors it consists of.
I’m stuck in how to find contiguous areas. Any pointers on where to start?
Imagine the following grid:
Each larger square is a gameobject tile, each having a different layout. i want to calculate the size of the larger red area (7 squares)