So uh, I'm trying to make an event always hug the player's location. It can either be in front, behind or beside the player; basically adjacent. How can I do this? There are 2 possible scenarios I'm thinking of...
A. Make the event adjacent to the player. This means one of the 8 tiles surrounding the player tile. How do I check if any of these 8 tiles are passable/impassable or if they're occupied? After that check, the event should randomly be at 1 of these 8 tiles.
B. Or instead of a random tile surrounding/next to the player, I would also be okay with a specific tile in relation to the player's location. However, this approach would also have to account for the player's facing/direction. For example, if the player is facing Down, the event should be at (x-1,y-1) or (x+1,y-1).
Edit: Actually, I think I really just need a way to check if a certain tile is occupied or impassable. Thx.
A. Make the event adjacent to the player. This means one of the 8 tiles surrounding the player tile. How do I check if any of these 8 tiles are passable/impassable or if they're occupied? After that check, the event should randomly be at 1 of these 8 tiles.
B. Or instead of a random tile surrounding/next to the player, I would also be okay with a specific tile in relation to the player's location. However, this approach would also have to account for the player's facing/direction. For example, if the player is facing Down, the event should be at (x-1,y-1) or (x+1,y-1).
Edit: Actually, I think I really just need a way to check if a certain tile is occupied or impassable. Thx.