xxxxxxxxxx
29
let shapeSize;
let x, y;
//these were variables
function setup() {
createCanvas(400, 400);
shapeSize = 50;
x = 0;
y = 0;
//initialize your variables
}
function draw() {
background(220);
ellipse(x, height / 2, shapeSize, shapeSize);
ellipse(width / 2, y, shapeSize, shapeSize);
//experiment with increment or decrement
x++;
//this is x=x+1
y++;
//RELATIONAL OPERATORS IN CLASS 7 Guide
if (x > width) {
x = 0;
}
if (y > height) {
y = 0;
}
}