Sunday, May 31, 2009

Bubbles01

// just type here
// and click "submit" when done



/*
 * Bubbles by Sophie & Davide, inspired by David Hirmes blobs
 * http://www.friendsofed.com/fmc/FMCv2/FMC.html
 */


int numberOfCircles = 32;

int[] xPositions = new int[numberOfCircles];
int[] yPositions = new int[numberOfCircles];

int circleSize = 50;

int canvasSizex = 400;
int canvasSizey = 400;


void setup() 
{
  size(canvasSizex, canvasSizey);
  background(204);
  
  smooth();
  
/*
  strokeWeight(4);  
  
  ellipse(50,50,circleSize,circleSize);

  ellipse(70,70,circleSize,circleSize);

noStroke();

  ellipse(70,70,circleSize,circleSize);

  ellipse(50,50,circleSize,circleSize);
*/

for(int i=0; i < numberOfCircles; i++){
  xPositions[i] = int(random(0,canvasSizex));
  yPositions[i] = int(random(0,canvasSizey));
}


}


void draw() {

  fill(204,30);
  rect(0,0,canvasSizex,canvasSizey);

  fill(255,255);

  for(int i=0; i < numberOfCircles; i++){
    xPositions[i] += int(random(-5,5));
    yPositions[i] += int(random(-5,5));
  }

  stroke(4);  
  strokeWeight(4);  
  for(int i=0; i < numberOfCircles; i++){
    ellipse(xPositions[i],yPositions[i],circleSize,circleSize);
  }

  noStroke();  
  for(int i=0; i < numberOfCircles; i++){
    ellipse(xPositions[i],yPositions[i],circleSize,circleSize);
  }

}

infoinfo

submitted by: sophie.mcdonald

Bethan recons this looks like how viruses behave! * Bubbles by Sophie & Davide, inspired by David Hirmes blobs * http://www.friendsofed.com/fmc/FMCv2/FMC.html */

Tags: bubbles, animation

commentscomment

loading loading...

 

sign in to Add a comment: