วันอาทิตย์ที่ 13 กันยายน พ.ศ. 2558
Lab 4 : Balloon
void setup(){
size(300,300);
}
void draw(){
background(#ffffff);
int posX=0;
int posY=mouseY;
int num=5;
if(posY<100){
fill(#F28EED);
}else if(posY>=100 && posY<200){
fill(#B48EF2);
}else{
fill(#486FD8);
}
draw_balloon(posX,posY,num);
}
void draw_balloon(int posX,int posY,int num){
int count=0;
int spread=0;
while(count<num){
strokeWeight(4);
stroke(#623936);
int string_length =70;
line(posX+spread,posY,posX+spread,posY+ string_length);
ellipse(posX+spread,posY,50,50);
spread+=70;
count++;
}
}
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น