let colors = ['#06aed5', '#086788', '#f0c808', '#000000', '#FFFFFF'];
for (let i=0 ; i < nbr; i++) {
mods[i].cotey = height/8;
mods[i].ptxorig = i % 8 * 100 + 50;
mods[i].ptyorig = floor (i / 8) * 100 + 50;
mods[i].ptx = mods[i].ptxorig;
mods[i].pty = mods[i].ptyorig;
mods[i].sens = floor(random(0, 4));
mods[i].pasx = random(0.3, 0.6);
mods[i].pasy = random(0.3, 0.6);
mods[i].a = color(colors[0]);
mods[i].b = color(colors[1]);
mods[i].c = color(colors[2]);
mods[i].d = color(colors[3]);
mods[i].e = color(colors[4]);
strokeWeight(2); stroke(255); fill(0, 20); rect(0, 0, 802, 802);
for (let i = 0; i < nbr; i++) {
constructor(cotex, cotexPlus, cotey, coteyPlus, ptxorig, ptyorig, ptx, pty, sens, pasx, pasy, angle, anglePlus, clix, cliy, a, b, c, d, e) {
this.angle += this.anglePlus;
for (let i = 0; i < 5; i++){
strokeWeight(2); stroke(mods[0].a); fill(this.b); ellipse(this.ptxorig , this.ptyorig , i*5, i*5);
strokeWeight(2); stroke(mods[1].b); fill(this.b); ellipse(this.ptxorig , this.ptyorig , i*4, i*4);
strokeWeight(2); stroke(mods[2].c); fill(this.b); ellipse(this.ptxorig , this.ptyorig , i*3, i*3);
strokeWeight(2); stroke(mods[3].d); fill(this.b); ellipse(this.ptxorig , this.ptyorig , i*2, i*2);
strokeWeight(2); stroke(mods[4].e); fill(this.b); ellipse(this.ptxorig , this.ptyorig , i*1, i*1);
if (this.ptx > this.ptxorig + this.cotex){
this.cotex -= this.cotexPlus;
this.ptxorig += this.cotexPlus;
} else if (this.ptx < this.ptxorig - this.cotex){
this.cotex += this.cotexPlus;
this.ptxorig -= this.cotexPlus;
} else if (this.cotex < 30){
this.cotex -= this.cotexPlus;
this.pasx = random(0.3, 0.6);
if (this.pty > this.ptyorig + this.cotey){
this.cotey -= this.coteyPlus;
this.ptyorig += this.coteyPlus;
} else if (this.pty < this.ptyorig - this.cotey){
this.cotey += this.coteyPlus;
this.ptyorig -= this.coteyPlus;
} else if (this.cotey < 30){
this.cotey += this.coteyPlus;
this.pasy = random(0.3, 0.6);
this.clix = this.ptx + (cos(this.angle) * this.pousse);
} else if (this.sens == 1){
this.clix = this.ptx + (sin(this.angle) * this.pousse);
} else if (this.sens == 2){
this.cliy = this.pty + (sin(this.angle) * this.pousse);
} else if (this.sens == 3){
this.cliy = this.pty / (sin(this.angle) * this.pousse);
noStroke(); fill(255); ellipse (this.clix, this.cliy, 2, 2);
stroke(255); noFill(); ellipse(this.ptx, this.pty, 6, 6);