Oki, that didn't work sadly. My code:
function loadScene() // Screen scrolls (WrapU) but keeps falling off page
SetViewOffset(sW+sW,0)
// Load Background Image
bgImg = LoadImage("level.png")
// Set U wrap mode to repeat
SetImageWrapU(bgImg, 1)
// Create background sprite
bgSpr = CreateSprite(bgImg)
SetSpriteSize(bgSpr, sW, sH)
// Sprite's position
SetSpritePosition(bgSpr,sW + sW,0)
FixSpriteToScreen(bgSpr,0) // o =world sprite, 1= screen sprite
endfunction
[\code]
The level backdrop scrolls, but as it's doing so, it's slowly moving to the left, until it's now off screen, and i'm left with a blank background. I know it has something to do with my control function:
[\code]
function userControls()
//Screen Scrolls, and player can fly either up, or down.
do
x# = x# +3
setviewoffset(sW + sW + x#, 0) // screen actually moves
yAxis = yAxis + GetDirectionY() * speed
xAxis = xAxis + GetDirectionX() * speed
setspritex(1,screentoworldx(200 + xAxis))
setspritey(1,ScreenToWorldY(500 + yAxis))
// Increase background offset by speed set previously
bgOffset = bgOffset + bgSpeed
// Update the UV offset of the sprite
SetSpriteUVOffset(bgSpr, bgOffset, 0.0)
// wall commands not working right
if getspritex(1) + getspritewidth(1) > ScreenToWorldX(sW)
rightWall = ScreenToWorldX(sW) - getspritewidth(1)
setspritex(1, rightWall)
endif
sync()
loop
endfunction
Also having problems with my plane sprite getting it to stop going past the right wall. The sprite stops, but something's still moving. Hold for 4 seconds, takes 4 seconds for the sprite to respond to the left movement etc. But this is not my main concern at the moment.
Khadin