let bord, header, nbLignes, interLigne;
for (var i=0 ; i < nbmots; i++) {
mots[i].rectLarg = round(random(6, 9));
mots[i].rectLargBis = mots[i].rectLarg;
mots[i].rectLargPlus = 6;
mots[i].rectLargMax = random(24, 80);
mots[i].intermots = mots[i].rectLargMax + 24;
mots[i].rectHaut = random(24, 36);
mots[i].pty = header + mots[i].numLigne * interLigne;
rectMode(CORNER); strokeWeight(6); stroke(0); noFill(); rect(0, 0, 802, 802);
for (let i = 0; i < nbmots; i++){
constructor (ptx, pty, rectLarg, rectLargPlus, rectLargMax, intermots, rectHaut, rectCorn){
if (frameCount % 2 == 0){
if (this.numLigne < nbLignes){
if (this.rectLarg <= this.rectLargMax) {
this.rectLarg += this.rectLargPlus;
} else if (this.rectLarg > this.rectLargMax){
this.rectLarg = round(random(6, 9));
this.rectLargMax = random(24, 80);
this.intermots = this.rectLargMax + 24;
this.rectHaut = random(24, 36);
if (frameCount % 12 == 0){
if (this.ptx <= width - 180){
this.ptx += this.intermots;
this.pty = header + (this.numLigne * interLigne);
} else if (this.ptx > width - 180){
this.pty = header + (this.numLigne * interLigne);
} else if (this.numLigne >= nbLignes){
this.pty = header + (this.numLigne * interLigne);
rectMode(CORNER); strokeWeight(2); stroke(0, 40); fill(255, 20); rect(this.ptx , this.pty, this.rectLarg, this.rectHaut, this.rectCorn);