xxxxxxxxxx
18
let loc; // vector of location
let vel; // vector of velocity
function setup() {
createCanvas(windowWidth, windowHeight)
frameRate(60);
colorMode(HSB, 360, 100, 100, 100);
loc = createVector(width / 2, height / 2);
vel = createVector(random(-5, 5), random(-5, 5));
}
function draw() {
background(0);
noStroke();
fill(180, 50, 80, 80);
loc.add(vel);
circle(loc.x, loc.y, 40);
}