I'm trying to make a gameboy-style Zelda dungeon. It's a top-down, 8-directional movement sword and sorcery adventure.
I want this effect (it's complex to explain, so bear with me):
The camera should center on the hero as long as the camera window is not touching a wall. When the camera window is touching the wall, the hero moves around within that window space until the hero pulls away from the wall enough to center the hero back in that camera window.
VIDEO EXAMPLE: [https://www.youtube.com/watch?v=cec7dyk0Khw]
See how the room is bigger than the window size, but the window is bound to the edge of the room? That is what I want. In other words, I want the window bound to the edges of the rooms, but I want the hero to be bound to the window, and I want the window to center on the hero unless the window is bound by the room.
Please know that I do not want to have a separate layout for every room within a dungeon.