xxxxxxxxxx
26
let x, y;
let xSpeed, ySpeed;
let r, g, b;
function setup() {
createCanvas(400, 400);
background(220);
x = width/2
y = height/2
}
function draw() {
xSpeed = random(-5, 5);
ySpeed = random(-5, 5);
//update position
x = x + xSpeed;
y = y + ySpeed;
// display circle
fill(random(255), random(255), random(255))
circle(x, y, 50)
}