Open chjno opened 6 years ago
Say I'm using this image for my background:
First, I'll draw the same image twice side by side - one at (0,0) and one at (width,0). Then I'll have them both scroll at the same speed. Once the image on the left leaves the screen completely, I can have it jump to the right of the image that is currently on the screen.
Posting from email @eclipsate
Hi Chino,
I remember you gave me a suggestion for how to make a smoother transition for the background in my game. This is the code for my background, I think I said I should have the same image twice so it doesn’t skip when it rotates through? How would I do that?
image(bgImg, bgX, 0); bgX -= 2; if (bgX < -width) { bgX = 0; }
Thanks!