The method I mostly use is to use a cursor position for the scrolling map and one cursor position for the player.
If the player cursor moves one place then the scrolling map moves one step.
playercursorx = 20
mapcursorx = 0
The scrolling map is build from tiles (see blitzcoder) using data from an array. So if the player cursor is at 20,0 then the map cursor is at 20-5.
mapcursorx = playercursorx - 5
It can get a little complicated when using smooth scrolling and various other things.
If the player cursor moves one place then the scrolling map moves one step.
playercursorx = 20
mapcursorx = 0
The scrolling map is build from tiles (see blitzcoder) using data from an array. So if the player cursor is at 20,0 then the map cursor is at 20-5.
mapcursorx = playercursorx - 5
It can get a little complicated when using smooth scrolling and various other things.