//Flake class class Flake { PVector loc; PVector vel; PVector acc; char name; boolean falling; // Another constructor (the one we are using here) Flake(PVector l, char n) { loc = l.get(); name = n; acc = new PVector(0,(random(0.01,0.05)),0); vel = new PVector(0,0); falling = false; } void run() { render(); if (falling && !dead()) { update(); } if (!falling && (millis() > 5000)) { if (millis() > 11000) { falling = true; } else { int ran = int(random(1,5)*1000); if ((millis() % ran) < 1) { falling = true; } } } } // Method to update location void update() { vel.add(random(-0.05,0.05),0.0,0.0); vel.add(acc); loc.add(vel); } // Method to display void render() { displayFlake(loc.x,loc.y); } // Is the particle still useful? boolean dead() { if (loc.y >= (height)) { return true; } else { return false; } /* if (timer <= 0.0) { return true; } else { return false; } */ } void displayFlake(float x, float y) { // pushMatrix(); text(str(name), x, y); // popMatrix(); } }