xxxxxxxxxx
33
let x, y, x_mult, y_mult,time;
let color = "#00f";
let shape_width = 20;
let shapes = [];
function setup() {
createCanvas(400, 400);
x = -shape_width;
y = height / 2;
x_mult = shape_width;
y_mult = 200;
time=0;
shapes.push(new Shape(x,y));
}
function draw() {
strokeWeight(0);
fill(color);
background(255);
if (time % 40 == 0){
shapes.push(new Shape(x,y));
}
shapes.map((shape) =>{
shape.render();
shape.move();
});
time += 1;
}