import hpglgraphics.*;
import processing.serial.*;


Serial myPort;

Boolean penDown=false;

//Balloon oneBalloon;

ArrayList<Balloon> mB  = new ArrayList<Balloon>();

void setup() {

  size(1104, 772);

  HPGLGraphics hpgl = (HPGLGraphics) createGraphics(width, height, HPGLGraphics.HPGL);

  hpgl.setPaperSize("A4");

  hpgl.setPath("output.hpgl");
  beginRecord(hpgl);


  color trempCol = get(100, 100);



  for (int i = width/4; i < width; i+=width/2) {
    for (int j = height/4; j < height; j+=height/2) {
      for (int k =0; k<15; k++) {





        mB.add(new Balloon(i+random(-40, 40), j+random(-40, 40), 1));
      }
    }
  }
}

void draw() {
  //background(255);

  //oneBalloon.drawSelf();
  //oneBalloon.rise();
  //oneBalloon.checkBorder();
  ////oneBalloon.windRandom(10);
  //oneBalloon.windSine(2);


  for (int i = 0; i<mB.size(); i++) {
    mB.get(i).update();
  }
}

void mousePressed() {

  endRecord();
  saveFrame("Noisey_####.png");
}
