xxxxxxxxxx
60
let scoop;
let cone;
let scoopX;
let scoopY;
let scoopSize;
let coneX1;
let coneY1;
let coneX2;
let coneY2;
let coneX3;
let r;
function setup() {
createCanvas(600, 600);
fill(255);
stroke(0);
strokeWeight(10);
scoop = 10;
cone = 100;
scoopX = width/6;
scoopY = height /6;
scoopSize = width * 0.2;
coneX1 = width*-0.1;
coneY1 = height/5;
coneX2 = width*0.0025;
coneY2 = height /2.5;
coneX3 = width*0.1;
coneY3 = height/5;
r = random(-0.025, scoopSize);
}
function draw(){
background(255);
translate(width/2, height/3);
strokeJoin(ROUND);
for(let i = 0; i < scoop; i++){
ellipse(0, scoopSize , scoopX * i, scoopY);
}
for(let i = 0; i < cone; i++){
triangle(coneX1, coneY1, coneX2 * r, coneY2 + i, coneX3, coneY3);
}
}
function mouseClicked(){
scoop = random(5);
coneY2 = random(100,300)
coneX2 = random(-2,2)
}