I'm making a world generation system with an array linked to a tilemap.
On initiation, there's all of these empty holes that really annoy me. How do I identify these gaps in an array?
gph.is/2zGV3p7
Develop games in your browser. Powerful, performant & highly capable.
After you finished generating the terrain, loop through all cells in the array. If current cell value is 0, check cells above (y-1), below (y+1), on the left (x-1) and right (x+1). If they all =1, then change the current cell from 0 to 1.