void stop() { sound.close(); super.stop(); } float falloff(float distance){ if (distance <1) distance=1; float falloff = distcon * (1/(distance*distance)); return falloff; } float volumeFalloff(float distance){ if (distance <1) distance=1; float falloff = (1/(distance*distance))*40; if (falloff >0.5) falloff=0.5; return falloff; } float panValue (float left, float right){ float right2, left2; float totalval = left+right; if (left>right) { left2 = 1; right2 = right/left; } else { right2 = 1; left2 = left/right; } // now the big one is 1, the other is less than one. float result = right2-left2; return result; } void drawcomet(){ // noStroke(); // fill(255,0,0,10); // ellipse(cometx,comety,170,170); // fill(255,0,0,20); // ellipse(cometx,comety,140,140); float widthmod = halo.width/2; float heightmod = halo.height/2; // draw 9 haloes noTint(); image(halo,cometx-widthmod-skwidth,comety-heightmod-skheight); image(halo,cometx-widthmod-skwidth,comety-heightmod); image(halo,cometx-widthmod-skwidth,comety-heightmod+skheight); image(halo,cometx-widthmod,comety-heightmod-skheight); image(halo,cometx-widthmod,comety-heightmod); image(halo,cometx-widthmod,comety-heightmod+skheight); image(halo,cometx-widthmod+skwidth,comety-heightmod-skheight); image(halo,cometx-widthmod+skwidth,comety-heightmod); image(halo,cometx-widthmod+skwidth,comety-heightmod+skheight); // draw 9 comet images, for wrapping-fooling purposes: widthmod = cometimg.width/2; heightmod = cometimg.height/2; tint(255, 255, 255, 255); image(cometimg,cometx-widthmod-skwidth,comety-heightmod-skheight); image(cometimg,cometx-widthmod-skwidth,comety-heightmod); image(cometimg,cometx-widthmod-skwidth,comety-heightmod+skheight); image(cometimg,cometx-widthmod,comety-heightmod-skheight); image(cometimg,cometx-widthmod,comety-heightmod); image(cometimg,cometx-widthmod,comety-heightmod+skheight); image(cometimg,cometx-widthmod+skwidth,comety-heightmod-skheight); image(cometimg,cometx-widthmod+skwidth,comety-heightmod); image(cometimg,cometx-widthmod+skwidth,comety-heightmod+skheight); } void draworbit(){ float widthmod = orbitimg.width/2; float heightmod = orbitimg.height/2; tint(255, 255, 255, 255); // draw 9 orbit images, for wrapping-fooling purposes: image(orbitimg,orbitx-widthmod-skwidth,orbity-heightmod-skheight); image(orbitimg,orbitx-widthmod-skwidth,orbity-heightmod); image(orbitimg,orbitx-widthmod-skwidth,orbity-heightmod+skheight); image(orbitimg,orbitx-widthmod,orbity-heightmod-skheight); image(orbitimg,orbitx-widthmod,orbity-heightmod); image(orbitimg,orbitx-widthmod,orbity-heightmod+skheight); image(orbitimg,orbitx-widthmod+skwidth,orbity-heightmod-skheight); image(orbitimg,orbitx-widthmod+skwidth,orbity-heightmod); image(orbitimg,orbitx-widthmod+skwidth,orbity-heightmod+skheight); }