xxxxxxxxxx
43
// create circle drawing thing
// test distance with pmouse
// create our own pmouse, px, py
// change size according to speed, this time use the real pmouse
// change circles for squares
// orient squares using atan2()
let px, py;
function setup() {
createCanvas(400, 400);
background(255);
fill(0);
noStroke();
px = mouseX;
py = mouseY;
}
function draw() {
// is the mouse pressed
if(mouseIsPressed) {
// calculating the distance
// between the mouse and the previous mous
let distance = dist(px,py,mouseX, mouseY);
// checking if that distance is big enough
if(distance > 10){
// drawing the circle
circle(mouseX, mouseY,10);
// update previous glyph position
px = mouseX;
py = mouseY;
}
}
}