xxxxxxxxxx
let seasoning = new Array(100);
function setup() {
createCanvas(600, 600);
background(250, 247, 212);
for (let i = 0; i < seasoning.length; i++) {
seasoning[i] = random(0, 600);
}
}
function draw() {
fill(0);
textSize(20);
textAlign(CENTER);
textFont("Helvetica");
text('Click to add salt and pepper to the mashed potatoes', width/2, 30);
//mashed potato levels
fill(250, 247, 212);
beginShape();
curveVertex(0, 600);
curveVertex(0, 600);
curveVertex(100, 500);
curveVertex(200, 450);
curveVertex(300, 500);
curveVertex(400, 450);
curveVertex(500, 500);
curveVertex(600, 600);
curveVertex(600, 600);
endShape();
beginShape();
curveVertex(0, 400);
curveVertex(0, 400);
curveVertex(100, 300);
curveVertex(200, 350);
curveVertex(300, 300);
curveVertex(400, 250);
curveVertex(500, 300);
curveVertex(600, 400);
curveVertex(600, 400);
endShape();
beginShape();
curveVertex(0, 400);
curveVertex(0, 400);
curveVertex(100, 100);
curveVertex(200, 50);
curveVertex(300, 100);
curveVertex(400, 50);
curveVertex(500, 100);
curveVertex(600, 200);
curveVertex(600, 200);
endShape();
}
function mousePressed(){
for (let i = 0; i < seasoning; i++) {
seasoning[i] = random(0, 600);
let y = random(0, 600);
frameRate(0.2);
noStroke();
fill(200);
ellipse(seasoning[i], y, 2, 2);
}
for (let i = 0; i < seasoning.length; i++) {
seasoning[i] = random(0, 600);
let y = random(0, 600);
frameRate(0.2);
noStroke();
fill(0);
ellipse(seasoning[i], y, 2, 2);
}
}