void setup(){
size(600,400);
}
void draw(){
for (int x=0; x<600; x+=100){
for (int y=0; y<400; y+=100){
fill(256, 0, 0);
rect (x,y,100,100);
fill(0, 0, 128,128);
ellipse (x+51,y+51,90,90);
fill(0, 200, 160);
rect (x+26,y+26,50,50,10);
}
}
}
========================================================================
color[][]mycolor = 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)); //*****
}
}
}
void draw(){
for (int x=0; x<600; x+=100){
for (int y=0; y<400; y+=100){
fill(256, 0, 0);
rect (x,y,100,100);
fill(mycolor[x/100][y/100]);//*****
ellipse (x+51,y+51,90,90);
fill(100, 200, 0,dist(x,y,mouseX,mouseY)*3.1);
rect (x+26,y+26,50,50,10);
}
}
}
========================================================================
速度還可以
新鮮不會單調,不時會有意外的亮點。
沒有留言:
張貼留言