Justin - E

By Justin Chen
//This allow you to add fireworks to a quiet night in Tokyo PImage t; PImage f; PImage b; void setup() { size(400, 400); //An Image of Tokyo's night t= loadImage("TNight.jpg"); background(t); f= loadImage("firework.png"); b= loadImage("bright.png"); //When the mouse is pressed, firework appears //when the mouse is not pressed, the sparks form the trail before the firework show } void draw() { if (mousePressed == true) { int ix= mouseX - f.width/2; int iy= mouseY - f.height/2; image(f, ix, iy); } else { int ix= mouseX - b.width/2; int iy= mouseY - b.height/2; image(b, ix, iy); } }

One Comment

  1. wangl
    Posted October 20, 2008 at 11:38 am | Permalink

    cool fire works. well done. it’s very pretty

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*