xxxxxxxxxx
39
function setup() {
createCanvas(800, 750);
}
function draw() {
background(0);
fill("orange");
ellipse(width / 2, height / 2, 200,200);
for(n = 0; n < 3; n++){
for(i = -1; i < 4; i++){
ghost(i*200+frameCount%50*4, n*300, 1);
}
}
for(n = 0; n < 2; n++){
for(i = -1; i < 4; i++){
ghost(i*200-frameCount%50*4+400, n*300+150, -1);
}
}
}
function ghost(x, y, s){
push();
translate(x, y);
scale(s, 1);
stroke(1);
fill("white")
ellipse(95, 100, 110, 110)
arc(140, 130, 50, 20, -PI*2/3, PI*2/3, OPEN)
ellipse(95, 100, 110, 110)
arc(80, 130, 50, 20, -PI*2/3, PI*2/3, OPEN)
fill("black");
arc(100, 100, 30, 30, 0, PI+PI/8, OPEN);
ellipse(80, 75, 10, 10);
ellipse(125, 80, 10, 10);
pop();
}