xxxxxxxxxx
23
let x = 0;
let speed = 1.8;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
scrollCity(x);
scrollCity(x+width);
x-=speed;
if(x <= -width) x = 0;
}
function scrollCity(x) {
push();
translate(x,height-100);
rect(0,0,width,100);
rect(0,-100,70,250);
rect(100,-50,200,150);
pop();
}