xxxxxxxxxx
22
let rSize=150;
let x = (-rSize)/2;
let y = (-rSize)/2;
function setup() {
createCanvas(400, 500);
rectMode(CENTER);
background(220);
}
function draw() {
background(220);
rect(x,y,rSize,rSize);
x = x + 3;
if (x >= width + rSize/2){
x = -rSize/2;
}
y = y + 3;
if (y >=width + rSize/2){
y = -rSize/2;
}
}