xxxxxxxxxx
27
let gfxs;
function setup() {
createCanvas(1000, 1000);
background(220);
gfxs = [];
for (let i = 0; i < 4; i++) {
gfxs.push({g:createGraphics(width/2,height/2),r:random(0,width)});
gfxs[i].g.background(random(255));
}
}
function draw() {
image(gfxs[0].g,0,0);
image(gfxs[1].g,width/2,0);
image(gfxs[2].g,0,height/2);
image(gfxs[3].g,width/2,height/2);
for (let i = 0; i < 4; i++) {
gfxs[i].g.fill(random(255));
gfxs[i].g.ellipse(width/4,height/4,gfxs[i].r);
gfxs[i].r += random(0.5,5.0);
if (gfxs[i].r > width/2) gfxs[i].r = 0;
}
}