G, i assume e your are using a tiled scrolling background....this is the most memory and speed efficient:
Lets assume for this you are scrolling horizontally;
If player moves right
If we at the beginning of the map (the far left as drawn)
If player is on the left side of the screen
If (Check map collision( moving right speed)) = false //no collision with solid tile
Move player right by speed
Else
If ( Check map collision(moving right speed)) = false
Scroll map by speed left
Endif
Endif
Endif
Endif
You can also add code for visually pixel perfect collisions....ie...
If (check map collision(moving right speed)) = true. // we have hit a solid tile
Find map coords of solid tile in pixels
Find difference between player x and solid tile x
Move player / scroll map number of pixels different
Endif
Please note this assumes you are using square tiles....if not use physics all the way!
Just my thoughts....
www.bitmanip.com
All the juicy you could ever dream of!