xxxxxxxxxx
27
let xShift, yShift;
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
angleMode(DEGREES);
blendMode(SCREEN);
}
function draw() {
// MOUSE MOVEMENT
let sluggishness = 6
xShift = (width/2 - mouseX)/sluggishness;
yShift = (height/2 - mouseY)/sluggishness;
clear()
background(0);
fill(255, 0, 0);
circle(width / 2, height / 2 - yShift, height / 2);
fill(0, 255, 0);
circle(width / 2 - xShift, height / 2 + yShift, height / 2);
fill(0, 0, 255);
circle(width / 2 + xShift, height / 2 + yShift, height / 2);
}