Files
processing4/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde
2012-12-11 20:04:34 +00:00

24 lines
346 B
Plaintext

// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
class Particle {
PVector location;
Particle() {
location = new PVector();
}
void setLocation(float x, float y) {
location.x = x;
location.y = y;
}
void display() {
fill(random(255));
ellipse(location.x,location.y,16,16);
}
}