In my Phaser game, I want to use a cell-like background texture which moves when you move.
My idea was to add each cell in a for loop like this:
let width=100, height=100;
for(let y=0;y<width;y++){
;
for(let x=0; x<height;x++){
this.physics.add.image(width/2+64*x, height/2+64*y, "snow_field").setScale(4,4);
}
}
The problem: The game gets very (very) slow
So is there a better / recommended way to add repeating images/backgrounds?