Scrolling map

I want to achieve movement like Legends of Yore where the map scrolls whenever I reach a certain position. I have no current code at the moment and was wondering if anyone could point me in the right direction to get something like this working.

Thanks,
Shazer2.

The basic idea, or at least the way I think about it, is that you aren’t actually moving the user your moving the map and everything else around the user. So your basically tricking whoever is playing your game into thinking that their player is moving when in reality it isn’t.

I worked out a very rough code block for this some time ago, i don’t have the code but the general idea was like this:

Make the player coordinates final, put him in the middle of the screen, then load up a 2D array of tiles, give them relative coordinates, coordinates that is changeable that is. When the player moves, instead of adding velocity to the player, add it to the tiles so that they move. Each update you loop through the tiles within view of the player in a nested for loop to update their current position with the
position X = velocity X * elapsed time
Position Y = velocity Y * elapsed time

Rough sketch, but i hope this helps you a bit at least

I find a good way of doing it is moving the player freely (as Kurten said) and then scroll everything by his offset from the center of the screen. The great thing about this is you can change it up so that the map only scrolls when you get the edges and such, and the player’s position actually changes (as it should, because he does exist within the world).

Think of it this way: the character is moving around within the world, what is staying centered is actually the camera that’s watching him. The world itself is not moving, only the camera and character are. So the character moves, then the camera follows.

Make sense?