วันพุธที่ 9 กันยายน พ.ศ. 2558

LAB 4 BALLOON LOOP

void setup(){
  size(700,600);
  background(0);
  stroke(255);
  int X=20;
  int R=20; // r is radiuse
  int Y=500;
  int num=0; // count number of balloon
 
  while(X<600){
    balloon(X,R,Y,num);
    num++;
    X += 80;
    Y -= 40;
    R += 10;
  }
}

// make function for make balloon
void balloon(int X,int R,int Y,int num){
  ellipse(X,Y,R,R);
  line(X,Y,X,Y+2*R);
 
  fill(0);
  text(+num,X-5,Y); // make number off balloon
 
  fill(255);
  }
 
 

ไม่มีความคิดเห็น:

แสดงความคิดเห็น