Particle[] particles; PImage rose; void setup() { size(769, 591); rose = loadImage("rose.jpg"); particles = new Particle [millis()/10]; for (int i = 0; i < particles.length; i++) particles[i] = new Particle(); background(255); } void draw() { for (int i = 0; i < particles.length; i++){ particles[i].display(); particles[i].move(); } //saveFrame("ZMproj2-#####.png"); } int time; Particle() { x= width/2; y = height/2; float a = random(TWO_PI); float speed = noise(random(1,200)); vx = cos(a)*speed; vy = sin(a)*speed; } void display() { noStroke(); color c = rose.get(int(x),int(y)); fill(c, 5); ellipse(x, y, 12, 12); } void move() { x = x + vx; y = y + vy; if (y<0) { vy = -vy; } if (y>height) { vy = -vy; } if (x<0) { vx = -vx; } if (x>width) { vx = -vx; } } }