xxxxxxxxxx
22
function setup() {
createCanvas(400, 400);
background(240);
}
function draw() {
if (mouseIsPressed) {
strichstaerke = random(7);
strichfarbe = random(255);
strokeWeight(strichstaerke);
stroke(strichfarbe);
let x1 = mouseX + random(-10, 10);
let y1 = mouseY + random(-10, 10);
let x2 = mouseX + random(-10, 10);
let y2 = mouseY + random(-10, 10);
line(x1, y1, x2 , y2);
}
}
function keyPressed(){
background(240);
}