Flood fillSample capx
"Action:Get moveable area" is using flood fill to find moveable area through "Condition:On cost". This feature also could be use for other propose, like picking neighbor chess/tile which have the same color in sample capx.
The steps of picking are -
1. Save target color in variable.
2. Call "Action:Get moveable area", sets the parameter of moving point to 1.
3. In "Condition:On cost", pick tile/chess instance by expression: TileUID, or ( expression: TileX, expression: TileY ), see Cost function section for more detail.
4. Compare the color of picked instance with target color -- If the color of picked instance is matched to target color, return cost to 0 by "Action:Set cost". Otherwise do nothing, the cost will be BLOCKING by default.
5. Finally, the matched tiles will be put into instance group by UID, then add the source tile into this group.