/** * A Christmas Card * heavily bootstrapped by Daniel Shiffman's particle class to get * my head straight... * * Flakes are generated each cycle through draw(), * This code isn't efficient, and possibly runs amok. * But hey, it's Christmas. */ import ddf.minim.*; Minim minim; AudioPlayer song; SnowCarol sc; String carol[]; PFont mainFont; void setup() { minim = new Minim(this); size(640, 480); colorMode(RGB, 255, 255, 255, 100); song = minim.loadFile("whistle.mp3"); mainFont = loadFont("Baskerville-Bold-14.vlw"); textFont(mainFont,14); carol = loadStrings("endcarol.txt"); sc = new SnowCarol(new PVector(5,5), carol); smooth(); song.play(); } void draw() { background(20,20,50); sc.run(); if (millis() > 15000) { text("Merry Christmas!",250,height/2); if (millis() > 17000) { text("(and a little bah humbug too!)",210,(height/2)+16); } } } void stop() { song.close(); minim.stop(); super.stop(); }