xxxxxxxxxx
23
var squaremov = 0
var increment = 20
function setup() {
createCanvas(400, 400);
}
function draw() {
squaremov = squaremov + increment
background('grey');
square(175, squaremov, 50);
fill('pink')
square(squaremov, 175, 50);
fill('yellow')
strokeWeight(0)
if (squaremov > 350){
increment = -2
}
else if (squaremov < 0){
increment = 20
}
}