RHYTHM GAME IN SCRATCH AND MICRO:BIT

make a rhythm game in scratch and play it using a micro:bit!


YOU WILL NEED

laptop
micro:bit
USB cable


STEP 1

Access Scratch from your web browser at scratch.mit.edu
Click create and give your project a name




Materials

laptop



STEP 2

In the editor, add the sprite Arrow1



STEP 3

Repeat step 2 until you have created 4 of the same arrow facing different directions. Directions can be changed by inputing different values into the Direction input box below.



STEP 4

Draw another sprite with the word “great”.



STEP 5

With arrow 1 selected, add another costume with different color. Color can be changed by pressing the fill section.
Name the new arrow Arrow1-a and old arrow arrow1-a



STEP 6

With other arrows selected, repeat step5 for other arrows and use a different color for each arrow. Name the new arrows respectively.



STEP 7

Add 2 extensions named music and microbit



STEP 8

With arrow 1 selected, copy the blocks below. Each code block can be found in the respective category depending on the block’s color.
For example, When (flag) clicked is a yellow block, and can be found under the events category which is labelled as yellow.



STEP 9

The costume “arrow1-a” is the original red arrow. The costume “Arrow1-a” is the other arrow of different color.
The naming here will appear differently depending on how you have named the arrows.

(skip if you are familiar with scratch)
The micro:bit block is found under micro:bit category and the music blocks are found under the music category



STEP 10



Materials

(skip if you are familiar with scratch)
To ceate the broadcast block, under events, drag the broadcast block onto the code editor then click create new message. A screen will pop up, type in “great!” then click ok.



STEP 11

(skip if you are familiar with scratch)
To create a variable, go to the variables category, click make a variable. Type “score” in the screen that pops up and click ok. The new variable “score” can now be selected in the dropdown from the blocks “set my variable” and “change my variable”



STEP 12

(skip if you are familiar with scratch)
To create “touching Arrow1” block under Arrow 1 sprite, first go to Arrow 2 sprite and drag “touching mouse-pointer” into the code editor
screen. Then, change it to Arrow1 via the dropdown. Lastly, drag and drop “touching Arrow1” block from Arrow 2 sprite into Arrow 1 sprite.



STEP 13

With arrow 2 selected, repeat step 8 and copy the blocks below. Costume arrow 1-d is the original red arrow, and costume arrow1-c3 is
the other arrow of different color. The naming here will appear differently depending on how you have named the arrows.



STEP 14

With arrow 3 selected, repeat step 9 and copy the blocks below. Costume arrow 1-c is the original red arrow, and costume arrow1-c2 is
the other arrow of different color. The naming here will appear differently depending on how you have named the arrows.



STEP 15

With arrow 4 selected, repeat step 9 and copy the blocks below. Costume arrow1-b is the original red arrow, and costume Arrow1-a2 is
the other arrow of different color. The naming here will appear differently depending on how you have named the arrows.



STEP 16

With sprite1 selected (the sprite with great! word), copy the blocks below.



STEP 17

Download Scratch Link on your computer and on computer’s bluetooth. Then, start Scratch Link
Link to Scratch Link (supports macOS, Windows, ChromeOS, Android): https://scratch.mit.edu/microbit




Materials

laptop
microbit



STEP 18

Connect micro:bit to your computer with a USB cable, then download the Scratch micro:bit HEX file, then drag and drop the HEX file into
the micro:bit connect to your computer.

Link to Scratch micro:bit HEX file: https://scratch.mit.edu/microbit




Materials

laptop
microbit
usb cable



STEP 19

Go to scratch and click the green flag button. Make sure you only have one scratch tab on your browser present! (close other copies of
scratch).



STEP 20

Enjoy the game!
Press (A) on microbit when the yellow arrow is touching the red arrow to score.
Press (B) on microbit when the purple arrow is touching the red arrow to score.
Flip the microbit down when the blue arrow is touching the red arrow to score.
Flip the microbit up when the green arrow is touching the red arrow to score.

To edit the number and rate at which the clone arrows are appearing, simply change the wait time or create more clones.

Press green flag to play the game and red button to pause the game


Made this activity? Good Job! Now spread the word. Share a photo of your creation on social media with #letsgethacking #RHYTHMGAMEINSCRATCHANDMICRO:BIT