// Draw fireflies over the Quickdraw logo // Code adapted from an exqmple on the Proessing.org websit // on March 6, 2010 by Andrew Jaremko and Alan Ferguson int currentFrame = 0; PImage[] frames = new PImage[24]; int lastTime = 0; int drawColor; PImage QASlogo; void setup() { size(500, 500); colorMode(HSB, 360,100,100); strokeWeight(12); smooth(); QASlogo = loadImage ("QASlogo.png"); image(QASlogo, 0,0); for (int i = 0; i < frames.length; i++) { frames[i] = get(); // Copy background to array } } void draw() { int currentTime = millis(); drawColor += 1; if (drawColor > 360) { drawColor = 0; } if (currentTime > lastTime+30) { nextFrame(); lastTime = currentTime; } //darken the backgroun then draw the firefly surrounded by a glow strokeWeight(45); stroke(0,0,0,64); if (mousePressed == true) { line(pmouseX, pmouseY, mouseX, mouseY); } strokeWeight(30); stroke(drawColor,100,100,48); if (mousePressed == true) { line(pmouseX, pmouseY, mouseX, mouseY); } strokeWeight(18); stroke(drawColor,100,100,48); if (mousePressed == true) { line(pmouseX, pmouseY, mouseX, mouseY); } strokeWeight(6); stroke(drawColor,100,100,255); if (mousePressed == true) { line(pmouseX, pmouseY, mouseX, mouseY); } } void nextFrame() { frames[currentFrame] = get(); // Get the display window currentFrame++; // Increment to next frame if (currentFrame >= frames.length) { currentFrame = 0; } image(frames[currentFrame], 0, 0); } void keyReleased(){ //clear the screen to the starting imaage image(QASlogo, 0, 0); for (int i = 0; i < frames.length; i++) { frames[i] = get(); // Copy the logo frame } }