How to make a fill algorithm like paper.io

I made a grid and ı can drawing a frame with my character but ı need the fill my frame like this:

I paint the ground if ı touch ground. They are a seperate object.I instantantiate it in a array.



Sorry but I am not sure what your asking here, can you explain in more detail / more clearly?

sounds like he wants similar flood fill system like in the old Qix game.

one old topic,

i once tried quickly to do it myself also, but failed (this code picks wrong area to fill)

In paper.io aim is very simple to get? Just overcome the biggest area. It looks easy at first since the game is very simple to play. But remember that it might be a bit tougher to master. In case you’re bold or cautious, outsmart your enemies by searching the finest way to triumph over the largest space. And stay safe, you have a frail point: your tail. We all can Test the game here to learn better. In case by any chance you ever touched by an enemy, you are dead. Also ensure that you defend your area because in Paper.io nothing is sure as long as you do not get the complete area. Stealing is lawful and your adversaries won’t vacillate to do so. After the success of Quiz Run and Bool, Voodoo provides a latest and amusing experience enthused by io kind games. Find the easiest way and policy on an io game in within a different graphic universe. Paper.io is for the entire family and needs no Internet connection. Doesn’t it sound great to you?