The problem that you have is that you bumped your own post. Generally when I browse through this forum, I check for posts that haven't already been picked up by someone else.
Anyway, your problem is with the backsave option of sprites. IMO, it's something you should always switch off.
Heres the code with changes commented (search for IanM):
rem setup display
set display mode 640,480,16
sync on
sync rate 60
load image "gulv1.bmp",1
load image "player.bmp",2
worldx = 0
worldy = -65
playerx = 10
playery = 300
` IanM : Ensure that the sprites are created here ...
sprite 1,worldx,worldy,1
offset sprite 1,xoffset,yoffset
sprite 2,playerx,playery,2
` IanM : ... So that I can switch backsave off for them
set sprite 2, 0, 1
do
` IanM : Now backsave is off, we need to do the clearing of the background ourselves
cls
if leftkey() = 1
dec xoffset,1
dec playerx,1
endif
if rightkey() = 1
inc xoffset,1
inc playerx,1
endif
if downkey() = 1
inc yoffset,1
inc playery,1
endif
if upkey() = 1
dec yoffset,1
dec playery,1
endif
if xoffset > 506 then xoffset = 506
if xoffset < 0 then xoffset = 0
if yoffset > -3 then yoffset = -3
if yoffset < - 77 then yoffset = -77
sprite 1,worldx,worldy,1
offset sprite 1,xoffset,yoffset
sprite 2,playerx,playery,2
set cursor 5,50
print "X offset: ", xoffset
set cursor 5,60
print "Y offset: ", yoffset
set cursor 5,70
print "FPS: ", Screen FPS()
sync
loop
*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++
http://www.matrix1.demon.co.uk