I've been trying to work this stuff out for a month now, and have finally had enough, so I thought I'd ask here.
The only way I've figured out how to vertically scroll my background is to simply move the image along the Y axis, but is there a better way?
I tried adapting the code from Space Shooter, but it appears that the UV coding only works for the X axis. Is there something that works on the Y axis?
I also want the scrolling to speed up every 30 seconds, but the only way I can figure out to do that is to code each 30 second period by itself (ie, 30, 60, 90, etc.), and I increase the speed only slightly each time, so that will be a lot of coding.
At the risk of looking like an idiot, I'll include the coding I use for this bit.
towerSP = LoadImage ( "tower.png" )
towerIM = CreateSprite (towerSP)
SetSpriteDepth (towerSP, 5)
SetSpritePosition (towerSP, 75, 0)
tower2SP = LoadImage ( "tower2.png" )
tower2IM = CreateSprite (tower2SP)
SetSpriteDepth (tower2SP, 5)
SetSpritePosition (tower2SP, 75, -3140)
// and in the main loop, I include this:
// Scroll screen
y# = 0.75
initialtime = GetSeconds ()
if initialtime >= 30
y# = y# + 0.25
endif
// and repeat that at 60, etc.
SetSpritePosition (towerSP, 75, GetSpriteY (towerSP) + y#)
SetSpritePosition (tower2SP, 75, GetSpriteY (tower2SP) + y#)
if GetSpriteY (towerSP) >= 1024
imagecount = imagecount + 1
if imagecount > towerIM + 2
imagecount = towerIM
endif
SetSpritePosition (towerSP, 75, -5254 + y#)
SetSpriteImage (towerSP, imagecount)
endif
if GetSpriteY (tower2SP) >= 1024
imagecount = imagecount + 1
if imagecount > tower2IM + 2
imagecount = tower2IM
endif
SetSpritePosition (tower2SP, 75, -5254 + y#)
SetSpriteImage (tower2SP, imagecount)
endif