xxxxxxxxxx
15
function setup() {
createCanvas(600,600);
background("#002FA7");
}
function draw() {
strokeWeight(5);
variableLine(mouseX, mouseY, pmouseX, pmouseY);
}
function variableLine(x, y, px, py) {
let mouseSpeed = abs(x - px) + abs(y - py);
stroke(255 - mouseSpeed);
line(width / 2, height / 2, x, y);
}