You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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!
The text was updated successfully, but these errors were encountered: