I have a bunch of sprites i want to render side by side.
let sprites = [sprite1, sprite2, sprite3];
sprites.forEach((_, i) => {
_.position.set(i * _.width, 0);
});
I want to move these sprites along the x axis controlled by tileX
variable.
sprites.forEach((_, i) => {
_.position.set(tileX + i * _.width, 0);
});
Tricky part is when a sprite reaches the left or right edge of the screen I want to move it to the opposite edge so it is rendered again.