Board Thread:Questions and Answers/@comment-76.246.71.61-20140815012928/@comment-70.128.118.126-20140815205351

I ran into this same problem while trying to create a large overworld map for a game I'm working on. I'm not certain how relatable my problem will be to yours as my game's construction may differ from yours. In mine, my character moves on a tile-based system so his movements line up with the placement of the background tiles. Also, the screen moves (or from a programming perspective, the background moves) only as the character approaches an edge of the screen, so the "camera" is not always centered on the character.

So my solution involved keeping track of three different variables, the position of the camera based on the overworld map (TILEX and TILEY), the position of the camera based on the background screen (BGX and BGY), and the position of the character based on the camera (X and Y). If the character is moving around the middle of the screen (and consequently, the camera isn't moving), then only X and Y are altered. If the character approaches the edge of the screen and the camera moves, then X and Y don't change but TILEX and TILEY (to keep track of where the character is on the overworld map), and BGX and BGY (to keep track of where to place tiles on the background screen) do change. This way, if you have the entire overworld map saved into an array, the program can check the array based on both TILEX/TILEY and X/Y to see if where you are walking is a space you can't walk on.