Hey, and thanks for reading in advance.
I recently got started making a crude attempt at my first tower defense game. I’ve got the enemy pathing set and I have a placement system in effect thanks to the helpful guide by EgoMoose (which I am now mercilessly deforming into something it wasn’t intended for).
I’ve run into a sort of issue design-wise, though - there are a few towers I want to increase the gridspace of as they upgrade, but obviously this shouldn’t be allowed if there exists no legal position the new tower could be placed in. For example, this tower changes from 1x1 to 2x2 once upgraded to rank 3.
I can reasonably conclude that it could achieve the transformation in a maximum of 4 possible directions from the cell it’s in now, but how would I check to make sure that the new tower wouldn’t overlap with existing towers or the road? Can I just perform a raycast from each adjacent cell?