arc & rect
@author
int X =25;
int Y = 25;
float step = 20;
void setup(){
size(500, 500);
noStroke();
fill(248, 248, 255);
}
void draw(){
background(255, 180, 0);
for(int x = 0; x < X; x++){
for(int y = 0; y < Y; y++){
pushMatrix();
translate(x * step + step / 2, y * step + step / 2);
if((x + y) % 2 == 0){
rotate(frameCount * 0.07);
} else {
rotate(-frameCount * 0.07);
}
if(x % 2 == 0 && y % 2 == 0){
arc(0, 0, step, step, HALF_PI, HALF_PI * 4);
} else if(x % 2 == 1 && y % 2 == 0){
arc(0, 0, step, step, HALF_PI * 2, HALF_PI * 5);
} else if(x % 2 == 0 && y % 2 == 1){
arc(0, 0, step, step, HALF_PI * 0, HALF_PI * 3);
} else if(x % 2 == 1 && y % 2 == 1){
arc(0, 0, step, step, HALF_PI * -1, HALF_PI * 2);
}
popMatrix();
}
}
}