I have a basic method of scrolling around on a map (moving the map instead of the player), but at when the player gets to a certain proximity to the edge, how do you stop the map from scrolling, but still allow the player to move around until it is away from that proximity? I'm not looking for any code. Just a suggestion so that I can implement it myself. I can see it visually (creating 4 boxed intersecting boundaries for the player to enter), but not sure how to come about stopping and resuming the scrolling of the map.
Define your viewport (position and size of the viewport). If you have this, you can define your borders. When your viewport position defines the upper left corner of your screen its pretty easy to restrict the screen position.
First of all you set the screen position to be centered on the player:
viewport.x = player.x - viewport.width / 2 viewport.y = player.y - viewport.height / 2
Then you have to make sure, that the viewport doesn't goes over the map.
if(viewport.x < 0) viewport.x = 0 if(viewport.y < 0) viewport.y = 0 if(viewport.x > map.width - viewport.width) viewport.x = map.width - viewport.width if(viewport.y > map.height - viewport.height) viewport.y = map.height - viewport.height
Basically this should be what you are looking for... You have to keep some things in mind, for example you can leave out the upper bounds check, if the screen size in that dimension is bigger than the map size ( viewport.width > map.width ). Also, if you have your map width in tiles instead of pixel, you would have to multiply the map sizes with the tile size.
If your screen position marks the middle of the screen, you would need to change some of the calculations a bit, but the basic idea is the same.
You shouldn't do scrolling like that, it is very counter intuitive. Just create a
Camera object, that has a position, and then render everything according to the camera's position. Move the camera around, don't change the entity positions, as that can alter your logic and mess everything up.
//If the camera is really far to the right, everything is rendered far to the left. render(e.sprite, e.position.x - camera.position.x, e.position.y - camera.position.y)