int X[] = {75,150,225};
int Y[] = {300,250,200};
void setup(){
size(400,300);
background(255);
frameRate(100);
}
int i = 0;
int a = 70;
int s = 90;
void draw(){
background(255);
for(int i=0;i<Y.length;i++){
balloon(X[i],Y[i],a,s);
Y[i]=Y[i]-1;
if (mousePressed){Y[i] = height -(50*i) ;
}
}
}
void balloon(int x,int y,int a,int s){
line(x,y+20,x,y+120);
fill(255,0,0);
ellipse(x,y,a,s);
triangle(x,y+45,x+5,y+50,x-5,y+50);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น