Klardonics
Member
Hopefully I can articulate what I'm trying to accomplish. I have a projectile that when it hits a wall (in this case I'm using tiles), it creates a vine object at that position (snapping it to the 8x8 grid that the game uses). I then want that vine object to expand for a couple more grid spaces, but hugging the tile wall (i.e. create several more vine objects that hug the wall).
In essence, it's simple to check whether an open grid space is adjacent to a wall:
However, things get more complex if there are more walls in the region that you don't necessarily want to create a vine on:
I really have no idea where to start with this, maybe arrays or ds grid. I looked into pathfinding for a bit, but knowing me I'll probably create something very convoluted and not performance friendly. I also had no idea how to search for similar problems to this -- not sure what I would look up. If someone could point me in the right direction, that'd be much appreciated!
In essence, it's simple to check whether an open grid space is adjacent to a wall:
However, things get more complex if there are more walls in the region that you don't necessarily want to create a vine on:
I really have no idea where to start with this, maybe arrays or ds grid. I looked into pathfinding for a bit, but knowing me I'll probably create something very convoluted and not performance friendly. I also had no idea how to search for similar problems to this -- not sure what I would look up. If someone could point me in the right direction, that'd be much appreciated!