Create a graphic fireworks show in Scratch with me as a fun artistic project, or to even celebrate the 4th of July! Use loops and random numbers to launch colorful fireworks into the night sky.
Who is this for?
- Language: Scratch
- Juni Level: Scratch Level 1
- Ages: 8-11
- Coding experience: Beginner, or familiar with basic concepts
- Difficulty Level: Easy, but every student is different!
|Core concepts used||Things to know beforehand|
|Loops||General familiarity with “Looks” blocks (i.e. set size, set color effect, hide/show, etc)|
Click the Green Flag to see the Scratch Fireworks show in action below. You can also view my project solution code if you get stuck.
What to look out for:
- There are actually multiple firework sprites all doing the same thing, but starting at slightly different times!
- The firework waits a little before it appears.
- When it appears, it’s always in a random place, with a random size, and a random color, and it makes a sound.
- When it’s done making a sound, it disappears again.
- This repeats over and over, forever!
General Steps to Build the Project
- Get your sprites & sounds ready.
- Make our firework wait and then appear in a random place with a random size and a random color, and make a sound.
- Make our firework do this over and over again forever.
- Make more fireworks, and make them all start at different times!
Step 1: Get your sprites & sounds ready.
- Either use my template or find your own pictures and sounds!
Step 2: Make our firework wait and then appear in a random place with a random size and a random color and make a sound.
- First, make the firework hide when the flag is pressed, wait a little bit, and then show.
- Add a block so that before it shows, it goes to a random position.
- Add a block so that before it shows, it becomes a random size.
- Add a block so that before it shows, it becomes a random color.
- Add a block so that it makes a sound when it shows!
Step 3: Make our firework do this over and over again forever.
- Use a forever block, and put it around all of the code we wrote!
Step 4: Make more fireworks, and make them all start at different times!
- Duplicate your sprite.
- For each copy, before it starts looping forever, make it hide and wait a little bit. This way it will start at a different time from the other sprite!
Great job! Want to keep learning?
We hope you enjoyed building Maya's project! To keep practicing or learning, check out more of our coding tutorials on our blog.
Looking up your coding questions is one of the best ways to learn!
Another great way to learn is from an experienced coder or instructor. Juni Learning CS Instructors like Maya work closely with students ages 8-18, and are specially trained to adapt to each child's unique learning style, pace, and interests.
We teach a variety of coding courses including Scratch, Python, Java, Web Development, AP Computer Science, and USACO. Read more about our coding courses and curriculum, or get started with our Admissions Team to learn which course is best for your child’s coding journey.