xxxxxxxxxx
39
function setup() {
createCanvas(500, 400);
angleMode(DEGREES);
}
function draw() {
background("white");
for(i=0;i<5;i++){
drawBeachball((frameCount + 100 * i) % width, 200, 1.2, "blue", "white");
}
for(i=0;i<5;i++){
drawBeachball((frameCount + 100 * i) % width, 260, 1.2, "blue", "white");
}
for(i=0;i<5;i++){
drawBeachball((frameCount + 400 * i) % width, 320, 1.2, "blue", "white");
}
for(i=0;i<5;i++){
drawBeachball((frameCount + 400 * i) % width, 380, 1.2, "blue", "white");
}
}
function drawBeachball(r, g, b, c1, c2) {
push();
// scale(3);
text("0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 ",r*8,g);
fill("#2366B4")
pop();
//Doris
}
function keyPressed() {
// this will download the first x seconds of the animation!
if (key == "s") {
saveGif("800x80", 5);
}
if (key == "c") {
saveCanvas(cnv, "myCanvas.png");
}
}