xxxxxxxxxx
let p;
function setup() {
createCanvas(windowWidth, windowHeight);
x = random(0,width);
y = random(0,height);
p = new Particle(x,y);
}
function draw() {
background(100);
p.update();
p.show();
p.x = mouseX;
p.y = mouseY;
// if (keyIsDown(UP_ARROW)) {
// p.y -= 10;
// }
// if (keyIsDown(DOWN_ARROW)) {
// p.y += 10;
// }
// if (keyIsDown(RIGHT_ARROW)) {
// p.x += 10;
// }
// if (keyIsDown(LEFT_ARROW)) {
// p.x -= 10;
// }
p.x = constrain(p.x, 0, width);
p.y = constrain(p.y, 0, height);
}