Projets

test processingjs

Processing.js Animation


//CodePool
//CodePool
Ball [] balls;
int cantBalls = 30 ;
float [] lastPosX;
float [] lastPosY;

void setup() {

  background(#FF007F);
  size( 640,400);
  smooth();
  lastPosX = new float[cantBalls];
  lastPosY = new float[cantBalls];
  balls = new Ball[cantBalls];

  for (int i = 0;i 20) {
      stroke(255,200);
      noFill();
      ellipse(balls[i].posx, balls[i].posy, 300, 300);
    }    

if(mousePressed){
lastPosX[i] = balls[i].targetPosX;
lastPosY[i] = balls[i].targetPosY;
balls[i].targetPosX = mouseX;
balls[i].targetPosY = mouseY;
balls[i].easing = random(0.01, 0.1);
}



    balls[i].dibujar();
    balls[i].grow();
    if (i>1) {
    }
  }
  

}

void mouseReleased(){
  for (int i=0;i