xxxxxxxxxx
24
let rWidth = 0;
let rHeight = 0;
let x = rWidth;
let y = rHeight;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
rect(x,y,50,50);
x = x+2;
y = y+2;
if(x >= width) {
x = rWidth;
}
if(y >= height) {
y = rHeight;
}
}