วันอาทิตย์ที่ 13 กันยายน พ.ศ. 2558

Lab 4 : Song

int x=50;

void setup(){
size(500,500);
}

void draw(){
  background(#FCECB5);
  draw_song(x,10);
}

void draw_song(int x,int y){
  int n=1;
  int sx=0;

  while(n<=3){

fill(0);                               //in door
stroke(0);
rect((150+x)+sx,300+y,200,250);

fill(#D36A06);                        //l door
stroke(#D36A06);
rect((135+x)+sx,300+y,15,250);

fill(#D36A06);                        //r door
stroke(#D36A06);
rect((350+x)+sx,300+y,15,250);

fill(#D36A06);                       //on door
stroke(#D36A06);
rect((135+x)+sx,285+y,230,15);

fill(#FF0B03);                       //open
stroke(#FF0B03);
ellipse((180+x)+sx,450+y,20,20);

/////word on door WELCOME////

fill(#E9FF03);
textSize(20);
text("W",(180+x)+sx,360+y);

fill(#03F9FF);
textSize(20);
text("E",(200+x)+sx,360+y);

fill(#05FF03);
textSize(20);
text("L",(220+x)+sx,360+y);

fill(#FF9F03);
textSize(20);
text("C",(240+x)+sx,360+y);

fill(#AC6BF7);
textSize(20);
text("O",(260+x)+sx,360+y);

fill(#6BF7CA);
textSize(20);
text("M",(280+x)+sx,360+y);

fill(#FF0000);
textSize(20);
text("E",(300+x)+sx,360+y);

/////name of song/////

fill(#0D08A5);
textSize(80);
text("Pra",x+sx,140+y);

fill(#08A50E);
textSize(80);
text("Tu",(150+x)+sx,140+y);

fill(#BC0606);
textSize(80);
text("Jai",(300+x)+sx,140+y);

/////name of singer/////

fill(#AC39F5);
textSize(40);
text("Sao Sao Sao",(x+100)+sx,210+y);

  n++;
  sx = sx+400;
  }
}

void keyPressed(){
  x=x+100;
}

void mousePressed(){
  x=x-100;
}

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

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