import krister.Ess.*; AudioChannel myChannel; Fog[] fogs; int totalFogs =0; void setup(){ frameRate(30); size(800,400); background(255); noStroke(); smooth(); fogs = new Fog[100]; Ess.start(this); // start up Ess myChannel=new AudioChannel("fog01.wav"); // load sound file into a new AudioChannel } void draw(){ myChannel.play(Ess.FOREVER); //background(255); fogs[totalFogs] = new Fog(); totalFogs++; if(totalFogs >= fogs.length){ totalFogs = 0; //Start over } for (int i=0; i < totalFogs; i++){ fogs[i].display(); fogs[i].move(); } fill(255,100); // background, color rect(0,0, width, height); } public void stop() { Ess.stop(); super.stop(); }