Hey all. I need help with a small problem. how would i go about making thhe background scroll? I know the basic concept(i think) but need some help in application.:confused:
Printable View
Hey all. I need help with a small problem. how would i go about making thhe background scroll? I know the basic concept(i think) but need some help in application.:confused:
so no one can help me?:(
Cmon, Please will someone help me with this!! It is needed for a game i am endeavering to make!
You can do this with BitBlt by changing the source and destination coordinates for the image over time
You also have to consider the special case of wrap arounds (would require two blts).
Z.
This is what i am trying to figure out.
Try this little proggie I made:
all values are Single except Sprite.Width and Sprite.Height
'Tile rects
xright = xleft + 5 * Sprite.Width
ybot = ytop - 5 * Sprite.Height
For yplot = ytop To ybot Step Sprite.Height
For xplot = xleft To xright Step Sprite.Width
Blit Sprite, xplot, yplot
Next xplot
Next yplot
'The greater than sign assumes that ytop increases each frame
If ytop > (pick a value) Then ytop = ytop - Sprite.Height
'The greater than sign assumes that xleft increases each frame
If xleft > (pick a value) Then xleft = xleft - Sprite.Width
ytop = ytop + 0.05
xleft = xleft + 0.001
How about just making it scroll on it's own? It will be a top-down scroller, like a shooter.
Well, just put the code in a timer !
If you want to make it scroll slowly right, you can add 1 to the XScroll value each time and then blit it.