class Nest { private Particle p; private int type, radius; Nest(float x, float y) { p = phys.makeParticle(1, x, y, 0); p.makeFixed(); type = NONE; radius = 90; } void kill() { p.kill(); } void tryCatch(Pulser puls) { if ( dist(puls.x(), puls.y(), x(), y()) < radius ) { puls.caught = true; puls.setMood(GLEE); puls.tether(p); puls.detach(); score(puls); } } void score(Pulser puls) { totalCaught++; puls.points = 100; score += 100; } float age() { return p.age()/frameRate; } void render() { stroke(255, 255, 0); noFill(); ellipse(x(), y(), radius, radius); } float x() { return p.position().x(); } float y() { return p.position().y(); } }