2013年9月15日 星期日

Week02 鄭羽婷

//Week02-1
void setup(){
  size(600,400);
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      rect(x,y,100,100);
    }
  }
}

//Week02-2
void setup(){
  size(600,400);
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      stroke(0,0,0);
      fill(255, 255, 255);
      rect(x,y,100,100);
      fill(255, 0, 0);
      stroke(255, 0, 0);
      triangle(x, y+80, x+50, y, x+100, y+80);
      triangle(x, y+20, x+50, y+100, x+100, y+20);
    }
  }
}


//Week02-3
void setup(){
  size(600,400);
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      fill(0,0, 255);
      rect(x,y,100,100);
      fill(255, 0, 0);
      triangle(x, y+80, x+50, y, x+100, y+80);
      triangle(x, y+20, x+50, y+100, x+100, y+20);
      stroke(0, 0, 0);
      noFill();
      triangle(x, y+80, x+50, y, x+100, y+80);
    }
  }

}



//Week02-4
void setup(){
  size(600,400);
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      fill(0,0, 255);
      rect(x,y,100,100);
      fill(255, 0, 0,dist(x,y,mouseX,mouseY)*2);
      triangle(x, y+80, x+50, y, x+100, y+80);
      triangle(x, y+20, x+50, y+100, x+100, y+20);
      stroke(0, 0, 0);
      noFill();
      triangle(x, y+80, x+50, y, x+100, y+80);
    }
  }
}

//Week02-4-2
void setup(){
  size(600,400);
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      fill(0,0, 255);
      rect(x,y,100,100);
      fill(255, 0, 0,dist(x,y,mouseX,mouseY)*2);
      triangle(x, y+80, x+50, y, x+100, y+80);
      triangle(x, y+20, x+50, y+100, x+100, y+20);
      stroke(0, 0, 0);
      noFill();
      triangle(x, y+80, x+50, y, x+100, y+80);
    }
  }
}
//Week02-5
color [][] myColor=new color[6][4];
color [][] myColor2=new color[6][4];
void setup(){
  size(600,400);
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      myColor[x/100][y/100]=color(random(256),random(256),random(256));
      myColor2[x/100][y/100]=color(random(256),random(256),random(256));
    }
  }
}
void draw(){
  for(int x=0;x<600;x+=100){
    for(int y=0;y<400;y+=100){
      fill(myColor[x/100][y/100]);
      rect(x,y,100,100);
      fill(myColor2[x/100][y/100],dist(x+50,y+50,mouseX,mouseY)*4);
      //fill(255,0,0,dist(x+50,y+50,mouseX,mouseY)*4);
      triangle(x, y+80, x+50, y, x+100, y+80);
      triangle(x, y+20, x+50, y+100, x+100, y+20);
      stroke(0, 0, 0);
      noFill();
      triangle(x, y+80, x+50, y, x+100, y+80);
    }
  }
}

//Week02-6心得

想寫一個簡單的手機遊戲!!
老師上課速度OK!!回家也可以看影片還好

沒有留言:

張貼留言