//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);
}
}Justin - E
on Tuesday, Oct 14, 2008 – 11:19 pm
One Comment
cool fire works. well done. it’s very pretty