Playing with Sounds
Hmm… something is missing from our animations. Can you guess what?
Sound! With sound, animations become more attractive. Let’s see how you can add sound to your animations.
What is Sound?
A sound is something that you hear when someone speaks, sings, or plays a musical instruments. It can be played, available by importing, built-in sound library, or recording.
Let’s see how to use them in an animation!
Activity: Adding Sounds
In this activity, we’ll make an animation of a barking dog in which whenever we press the spacebar, the dog will bark and go to a random location on the stage.
Choosing the Backdrop
Follow the steps below to add a backdrop.
And that’s it! The stage has now transformed from a blank space to a colorful jungle!
Choosing the Sprite
Follow the steps below to add a sprite.
- Using choose a sprite button, Choose the Dog1.
- Right-click on the Tobi icon in the sprite palette and delete it.
Now, let’s animate the dog.
Setting the Starting Position
As we will be working on two costumes of the dog, we first need to add the costume.
Switching Costumes and Playing Sounds
Gliding to a Random Position
- To make our Dog sprite glide randomly, We will use glide block from the motion palette.
- To switch back to initial costume, use switch costume block from looks palette.
Sensing the Space Key
- From the Events palette, add the following hat block. It will sense it when we press the space key and make the script run.
Saving the File
Save the file with the name Playing Sounds.
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox script you made in this activity to the website.
Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- Click on Choose File.
- Select the image from the pop-up window that opens up.
- Once the image is selected, click on Upload Assignment.