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