xxxxxxxxxx
30
let a; // center x
let b; // center y
let c; // x +
let d; // y +
let e; // x -
let f; // y -
function setup() {
createCanvas(600, 400);
a=c=e = width / 2;
b=d=f = height / 2;
}
function draw() {
background(220);
ellipse(c, b, 40, 40); // go right
c+=width/height;
ellipse(e, b, 40, 40); // go left
e-=width/height;
ellipse(a, f, 40, 40); // go up
f-=1;
ellipse(a, d, 40, 40); // go down
d+=1;
ellipse(e, f, 40, 40); // go top left
ellipse(c, f, 40, 40); // go top right
ellipse(e, d, 40, 40); // go bottom left
ellipse(c, d, 40, 40); // go bottom right
}