I don't really know much about sprites, but if I was going to do it I would do it on planes and scroll the texture. I'm sure there is another (probably better
) way of doing it, but try looking at:
` ASSIGNING SOME VARIABLES
DW = DESKTOP WIDTH()
DH = DESKTOP HEIGHT()
DD = SCREEN DEPTH()
WW = 640
WH = 480
RootDir$ = "C:\Test\"
` SETTING UP THE WINDOW DISPLAY
SET WINDOW ON
SET DISPLAY MODE WW,WH,DD, 0
SET WINDOW POSITION DW/2-320, DH/2-240
SET WINDOW TITLE "Parallax Background"
` SETTING UP CAMERA POSITION AND REFRESH RATE
SYNC ON
SYNC RATE 60
AUTOCAM OFF
POSITION CAMERA 0,0, -400
POINT CAMERA 0,0,0
` LOADS PICTURES AND CREATES THE OBJECT THE PICTURES WILL BE ON
FOR LoadBG= 1 TO 4
MAKE OBJECT PLANE LoadBG, WW, WH
LOAD IMAGE RootDir$ + "BackGround" + Str$(LoadBG) + ".png", LoadBG
TEXTURE OBJECT LoadBG, LoadBG
SET OBJECT TRANSPARENCY LoadBG,1
SET OBJECT LIGHT LoadBG, 0
POSITION OBJECT LoadBG, 0,0,-0.1 - LoadBG
NEXT LoadBG
` MAIN LOOP!
DO
FOR ParalaxBG = 2 to 4
SCROLL OBJECT TEXTURE ParalaxBG, -ParalaxBG*0.0008 * (KEYSTATE(30) - KEYSTATE(32)),0.0
NEXT ParalaxBG
SYNC
LOOP
`THE END :(
END
I also attached the pictures used in this example. Nothing fancy, just some quickly(poorly) drawn backgrounds.
My green thumb grew the tree my Trojan War horse was crafted from. With roses in our pockets we rally round the tombstones. Ashes to ashes, we all fall down.