I have a window looking out on the stars that should just scroll by slowly forever. It is a tiled background.
Whats the best way to do this?
Hey there, you can change its X position every tick, and when it reaches a certain point reset its position so it looks seamless
Yeah you need to make the tiled background twice as wide, if it goes from left to right or other way around.
So if the tiled background moves left (with bullet behavior), and your layout viewport is 500 pixels wide, you make the tiled background 1000 pixels wide. Then you can set its X position back to 0 when its X position reaches -500.
This example is for screen filling backgrounds, but you can make the tiled background smaller of course, you just need to figure out the coordinates together with the objects width.
Develop games in your browser. Powerful, performant & highly capable.
Thanks both of you, I will give this a try.