Fireworks

These steps are available at bit.ly/fireworks-steps.


Step 1: Remix the Starter Pack

Follow the link: bit.ly/fireworks-starter.

Next tap Remix. When the project loads, give it a new name. Have a look around the project.


Step 2: Choose or draw a background

Where do you want your fireworks display to take place? Maybe you could draw a background or generate one using AI!


Step 3: Wait for user to press the mouse

In the rocket sprite check when the mouse button is pressed tell it to launch.

This will not actually make the rocket appear. Instead it makes a clone (or copy) of the sprite and the next script will launch it.

when green flag clicked
hide
switch costume to (rocket v)
forever
    if <mouse down?> then
        create clone of (myself v)
    end
end

Step 4: Animate the firework

when I start as a clone
go to x: (0) y: (-180)
point towards (mouse-pointer v)
glide (1) secs to (mouse pointer v)
delete this clone

Step 5: Make only one rocket appear at a time

Have you noticed that if you hold the mouse button down, you will make lots of fireworks appear at once? If you want to fix this, you can add this right after you create the clone:

wait until <not <mouse down?>>

Step 6: Make the firework explode

Add this code right before we delete the clone:

repeat (3)
    next costume
    wait (0.2) seconds
end

Challenges