Thanks for playing!
a simplified rundown of the process would be:
- break if the player is not holding down the mouse
- get the mouse world position then floor it to an int get tile coords
- break out of the function If the player is hovering over a square that is blocked by a collision tile
- break out of the function if the player is hovering over a tile that is already in the list
- break out of the function if the player is hovering over a tile that isn't adjacent to an existing list entry
- Add the position to the list
- redraw arrow path
So basically take that process and sprinkle in 2 AM spaghetti coding to taste and you got my script