xxxxxxxxxx
21
let x1, y1;
function setup() {
createCanvas(400, 400);
background(245);
}
function draw() {
if (mouseIsPressed) {
line(x1, y1, mouseX, mouseY);
}
}
function mousePressed() {
x1 = mouseX;
y1 = mouseY;
}
function keyPressed(){
background(255);
}