1 2 3 4 5 6 7 8 9 10 |
// communication between objects (collison) // distance between centers // is dist < r1+r2 float d = dist(x, y, other.x, other.y); if (d < r + other.r) { return true; } else { return false; } |
1 2 3 4 5 6 7 8 9 |
// what's this do? void keyPressed() { if (key=='s' || key=='S') { counter++; saveFrame(counter+".png"); } } |