level 2
nt x =100;
boolean btGo=false;
boolean btBack=false;
void setup(){
size (400, 300);
}
void draw (){
background (0);
fill (255);
noStroke();
ellipse(x, height/2, 30, 30);
if((btBack)&&(x>width)){
x=x-1;
}
else if((btGo)&&(x<width)){
x=x+1;
}
}
void mousePressed(){
if(x>width){
btBack=!btBack;
}
else if(x<width){
btGo=!btGo;
}
}
2018年10月02日 02点10分