xxxxxxxxxx
41
var PosX = (25/2);
var PosY = 25;
let switchColor = false;
function setup() {
createCanvas(500, 500);
background(0);
}
function draw() {
noStroke();
if(switchColor){
fill(255);
}else{
fill(255,0,0);
}
circle(PosX,PosY,25);
PosX+=5;
if(PosX == width-(25/2)){
PosX = (25/2);
PosY+=50;
switchColor = !switchColor;
}
if(PosY > height){
background(0);
PosY = 25;
PosX = (25/2);
}
}