07 教孩子学编程 画运动的圆
2020-05-05 本文已影响0人
Mack老师
int x=100;
int direction=1;
void setup(){
size(640,640);
background(255);
}
void draw(){
background(255);
fill(255,0,255);
ellipse(x,200,50,50);
x=x+1*direction;
if(x>=575||x<=25)
direction=-direction;
}