- Home /
Question is off-topic or not relevant : Write-my-Code
How to remove gaps in a 2D map.
Using an algorithm, I procedurally create a 2D map in which 1 represents block/wall and 0 represents empty space.
Problem is, my algorithm generates some gaps that I would like to eliminate. What I mean is something like this
111
101
111
As you can see, there is a one cell in middle of walls. I like it to change into this:
111
111
111
How can I achieve it?
Thanks.
Well there a some problems with your question:
This is not Unity related.
According to you the problem lies within the algorithm, how can anybody help you if you if you didn't post the algorithm?
Please correct/improve your question.
I know it's not Unity related but I thought it would be a problem that another game dev might've faced before.
I'm afraid I can't fix the algorithm, I just need to fix the gaps that the algorithm generates in maps.