class Faucet extends PPPoly { int counter=-1; AudioPlayer dripSound; int framesBetweenDrops = 100; float x ,y; Faucet(float x, float y, int newframesBetween){ this(x,y); framesBetweenDrops = newframesBetween; } Faucet(float x, float y){ this.x = x; this.y =y ; dripSound = minim.loadFile("sounds/drip_1.mp3"); } boolean updateAndCheck(){ counter++; if(counter % framesBetweenDrops == 0){ dripSound.rewind(); dripSound.setGain(2); dripSound.play(); return true; } return false; } }