Hi, I’m facing a coding/math issue and was wondering if anyone could help.
I’m making a grid based puzzle game. When people trace a closed path of grid cells, all cells within this path shape need to explode. However, I can’t determine which cells are within this traced path or not.
I know the classic point-in-polygon method, but this doesn’t work with a grid-based shape (this is a simple ray intersection method which works for polygons, but not for grid cell based paths.
The path shape only makes 90 degrees angles, so no diagonals.
The attached image explains everything: how do I detect which cells are inside the closed path?