xxxxxxxxxx
41
// 2nd editor
function setup() {
createCanvas(500, 500);
angleMode(DEGREES);
background(200,200,100);
}
function draw() {
if (mouseIsPressed) {
brush(mouseX, mouseY);
}
if (keyIsPressed){
background(200, 200, 100);
}
}
function brush(X, Y) {
push();
translate(X,Y);
for(let i=0; i<50; i++){
let x = random(20,50);
let y = 0;
let StrawBerryLemonade = random(200, 255)
fill(StrawBerryLemonade, 150, 150);
rotate(random(0,360));
point(x,0);
rect(x,0, 25, 25);
if (x > 25) {
noStroke;
} else {
stroke(random(190,255),0,random(190,255))
}
}
pop();
}