the following p5js code did not work , since the object in array are reference to the flower , how can i initialize the object with different values ?
var flowers;
var flower;
function setup()
{
createCanvas(1000,500);
base_x = width/2;
base_y = height - 50;
flowers = [];
flower = {
base_x: 0,
base_y: height - 50,
stem_h: 100,
col: color(255,50,50)
}
for(var i = 0; i < 10; i++)
{
flower.base_x = i * 100;
flower.stem_h = random(50,400);
flower.col = color(
random(0,255),
random(0,255),
random(0,255)
);
flowers.push(flower);
}
}