The game im making at present uses a 320x240 res.
The character moves on a 32x32 tile movement
When the player leaves the screen at any end the screen scrols to the next screen,
(Like Lost Valley) heres the code:
ONLY WHEN EVENT LOOPS ONCE
+ X POSITION OF PLAYER >= X RIGHT FRAME
center desplay at X=X(player) +160
set X position to X (player) +2
ONLY WHEN EVENT LOOPS ONCE
+ X POSITION OF PLAYER <= X LEFT FRAME
center desplay at X=X(player) -160
set X position to X (player) -2
ONLY WHEN EVENT LOOPS ONCE
+ Y POSITION OF PLAYER >= Y BOTTOM FRAME
center desplay at y=y(player) +120
set Y position to Y (player) +2
ONLY WHEN EVENT LOOPS ONCE
+ Y POSITION OF PLAYER <= Y TOP FRAME
center desplay at y=y(player) -120
set Y position to Y (player) -2
It works fine but after the screen has scrolled a couple of times the screen is out of place, only by a few pixels but every time, but after alot of scrolls the screen is completly off.
Im pretty sure it has somthing to do with the bottom line of each code or the fact that the character moves 32x32 but i dont know if it is or how to fix it,
It could be something like the characters animation, if fine detection is turned on then the characters arm was sticking out could make a few pixels difference.
you could try a different method that counts the amount of tiles moved. Use either an alterable value or counter and count the amount of tiles moved.
pressed right+ counter/value = 10 scroll the screen to the right and set value to 0.
pressed left+ counter/value = 0 scroll the screen to the left and set value to 16.