xxxxxxxxxx
43
/*
https://editor.p5js.org/Anne-Laure/sketches/HwT2YQXiu
Generates two lots of 9 products each. A class of class !
Initially https://editor.p5js.org/Anne-Laure/sketches/oxoX4gqti
Cliquer sur la souris pour démarrer le mouvement
Cliquer pour stopper / redémarrer
*/
let products = [];
let lots = [];
let lotSize = 11 ; // ne pas dépasser 12
let demarrer = false ;
function setup(){
createCanvas(600, 400);
noStroke() ;
// Create a first school and a second one.
lots.push(new Lot( width / 10, height / 3, 0 ));
lots.push(new Lot( width / 10, 2* height / 3, 1 ));
// Loop over the array and generate the fish in each school.
for (let l of lots){
l.generateProduct();
}
}
function draw(){
background(204);
// Loop over the array and update each fish.
for (let l of lots){
l.show();
}
}
function mousePressed(){
demarrer = !demarrer ;
// fishes.push(new Fish(mouseX, mouseY));
}