Assignment 2: Drawing Fireworks

My concept

My project is a simple firework animation with randomly changing backgrounds. While reading the technical reading assigned for this week about randomness, I realized I wanted to incorporate that concept into my work. Another inspiration was the drawing exercise we did in class using mouseX and mouseY, so I decided to apply it here with the fireworks.

However, as I worked on the project, I realized that there’s a bigger meaning behind it. The randomness of the fireworks represents the unpredictability of life, with both the good and the bad. Each click creates a unique firework explosion, symbolizing how every action and decision in life leads to an outcome that can never be exactly repeated.

Code Highlight

One part of the code that I’m proud of is how I used user interactions to create the fireworks effect. On top of that, i created randomly changing backgrounds.

function mousePressed() {
  if (showText) {
    showText = false; 
    background(0); // Clear text from canvas
  }
  drawFirework(mouseX, mouseY);
  let randomBg = color( random(255), random(255), random(255) );
    background(randomBg); // Random Background with each click
}
function mouseDragged() {
  drawFirework(mouseX, mouseY); 
}

Reflection

This project taught me a lot, while allowing me to incorporate some concepts learned in class. While I initially struggled with creating the fireworks and spreading out the lines, I’m happy with how it turned out.

Also, i had an idea to add “Back” button so the user could return to the inital background and I hope the knowledge i’ll gain in classes will allow me to add such features.

Embedded Sketch

Leave a Reply