float posY, diam, posX;
void setup(){
size(1080,720);
diam = 50;
posY = 0-diam;
posX = width/2;
}
void draw(){
posY+=random(5);
posX+=random(4);
// background(0);
ellipse(posX,posY,diam,diam);
if (posY>height+diam){
posY=0-diam;
}
if (posX>width+diam){
posX= 0 - diam;
}
}
No comments:
Post a Comment