Files
sunny9898/task8/_ref/noc-examples-processing-master/chp03_oscillation/OOPWaveParticles/Particle.pde
louiscklaw 5637fbf94f update,
2025-02-01 02:07:58 +08:00

24 lines
346 B
Plaintext

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