xxxxxxxxxx
21
function setup() {
createCanvas(400, 400);
}
function draw() {
//only happens when the mouse is held down, but happens
//continuously
if (mouseIsPressed) {
line(pmouseX,pmouseY,mouseX, mouseY)
}
}
function mousePressed() {
//only happens when you click the mouse completely
let r = random(255);
// background(r,0,0);
ellipse(mouseX,mouseY,50)
console.log("mousePressed function " + r.toString())
}