Posted October 01, 2024 by Goutamraj
Filling is one of the important mechanisms used in this game.
So whenever the player acquires a new area, the acquired area should be filled with the player's given color, and at this particular place, the Flood fill algorithm helped me.
How?:
Every cell has its specific data, which includes its coordinates(X and Y) and the status(Filled/Unfilled/IsTrail), these helped to implement the flood fill algorithm.
You can check the implementation here Flood-fill implementation at line number 104.
You can check the video attached with this DevLog for a working demo, where "2" represents the filled cells.