xxxxxxxxxx
55
let x;
let y;
function setup() {
createCanvas(800, 400);
x = width / 2;
y = height / 2;
// createCanvas(400, 400);
// x = 200;
// y = 200;
// createCanvas(800, 400);
// x = 400;
// y = 200;
}
function draw() {
background(220);
ellipse(x, y, 20, 20);
// (400, 400) right bottom
// x++;
// y++;
// (400, 400) right top
// x++;
// y--;
// (400, 400) left top
// x--;
// y--;
// (400, 400) left bottom
// x--;
// y++;
// ------------------------------------
// (800, 400) right bottom
// x+=2;
// y++;
// (800, 400) right top
// x+=2;
// y--;
// (800, 400) left top
// x-=2;
// y--;
// (800, 400) left bottom
// x-=2;
// y++;
}