P
Poddington
Guest
Hi Everyone,
I'm having a bit of a coders block at the moment and I'm not sure even how to approach this. I have a game where I can create walls using a mixture of a DS grid and tiles. Tiles aren't important, but with the DS grid if I have a region that is surrounded by walls I'd like the area within the walls to be "indoors".
I could make the player assign indoors and outdoors, but I foresee this being exploited as if it's a zoned area they could zone the whole map to remove any outdoors.
Also the walls aren't placed all at once, but can be drawn either one block at a time or a whole section and also if a wall section is removed the room should become outdoors. I guess there will need to be a recurring check to do this.
the grid would look like this.
[1][1][1][1][1]
[1][0][0][0][1]
[1][0][0][0][1]
[1][0][0][0][1]
[1][1][1][1][1]
Any suggestions to attempt would be appreciated, I'll also mark as solved if I figure out a solution. The term flood fill may not be correct, but it's all I could think of at time of posting.
Thanks for your help.
I'm having a bit of a coders block at the moment and I'm not sure even how to approach this. I have a game where I can create walls using a mixture of a DS grid and tiles. Tiles aren't important, but with the DS grid if I have a region that is surrounded by walls I'd like the area within the walls to be "indoors".
I could make the player assign indoors and outdoors, but I foresee this being exploited as if it's a zoned area they could zone the whole map to remove any outdoors.
Also the walls aren't placed all at once, but can be drawn either one block at a time or a whole section and also if a wall section is removed the room should become outdoors. I guess there will need to be a recurring check to do this.
the grid would look like this.
[1][1][1][1][1]
[1][0][0][0][1]
[1][0][0][0][1]
[1][0][0][0][1]
[1][1][1][1][1]
Any suggestions to attempt would be appreciated, I'll also mark as solved if I figure out a solution. The term flood fill may not be correct, but it's all I could think of at time of posting.
Thanks for your help.