My game uses tiled, and right now I’m trying to decide how the game will register interactable objects. The game uses separate game states for each location, so I was thinking when the player interacts, it can just check his X and Y accordingly and match it that way, but I want to know if this is the most efficient way of doing it beforehand. What do you guys think?
If you map your world in Array of int or else, you can check if the player can interact by seeing their location and check value of the object they want to interact.
Do you have a class for tiles and interactables? I’d give the tile class a variable assigned to the interactable class, then if you try to interact, check to see if that tile’s interactable is null, if not proceed.