Can anyone spot my mistake here? The idea is that as the viewport moves, the background appears stationary as it follows the viewport. However, the sprite seems to be frozen at 0,0 and won't move. I have the getSpriteX() on screen and it is definitely changing.
if getSpriteX(gShip) - getViewOffSetx() > 220 and getViewOffSetX() < 1056
setViewOffset(getViewOffSetx() + 1, getViewOffsetY())
gBackdropX = gBackdropX + 1
setSpritePosition(gBackdropSprite, gBackdropX, getSpriteY(gBackdropSprite))
endif
if getSpriteX(gShip) - getViewOffSetx() < 260 and getViewOffSetX() > 0
setViewOffset(getViewOffSetx() - 1, getViewOffsetY())
gBackdropX = gBackdropX - 1
setSpritePosition(gBackdropSprite, gBackdropX, getSpriteY(gBackdropSprite))
endif
The value for the Sprite X value is displayed and moves as expected:
setTextString(gTextDebug, "Sprite X : " + str(getSpriteX(gBackdropSprite)))