xxxxxxxxxx
47
/*
source palette = https://coolors.co/067bc2-84bcda-ecc30b-f37748-d56062
*/
var objets = [];
var nbObjets = 10 ;
var pos ;
var palette = ["#067bc2","#84bcda","#ecc30b","#f37748","#d56062"] ;
function setup() {
createCanvas( windowWidth, windowHeight );
rectMode(CENTER);
noStroke() ;
for (let i = 0; i < nbObjets; i++) {
let x = width/2 + random( -width/3, width/3 ) ;
let y = height/2 + random( -height/3, height/3 ) ;
pos = createVector(x,y) ;
let obj = new Objet( pos.x, pos.y, i );
objets.push( obj );
}
}
function mousePressed() {
}
function draw() {
background(240);
for (let i = 0; i < objets.length; i++) {
objets[i].update();
objets[i].show();
}
}