You will add a cymbal sprite that you can click to earn beats and play a sound.
Click Choose a Sprite and search cymbal
. Add the Drum-cymbal sprite to your project.
Position your cymbal on the Stage:
Add the Music extension:
To use the Music blocks in Scratch, you need to add the Music extension.
Add a script to make the cymbal switch costume
and play a drum sound
:
Test: Test your cymbal by clicking on it. Make sure you hear a sound and see the costume change.
The Drum-cymbal sprite will earn you one beat each time you click it.
Create a variable
called beats
:
Add a block to change beats by 1
when the Drum-cymbal sprite is clicked:
Test: Test the Drum-cymbal by clicking on it and watch the beats
increase.
The
variable needs to start at beats
0
beats when you start a new game.
Click on the Stage pane and then the Code tab to add code to the Stage.
Add a block to set beats to
:0
Test: Click the green flag and make sure your
variable starts at beats
.0