Marty's Robot Reeling
Celebrate St Andrew's Day by creating a Scottish Country Dance routine for Marty based on a few simple repeated dance steps.
Using Scratch 3, you will create a program using blocks where you teach Marty some basic Scottish country dance moves, extending it to create your very own robot reel routine. If your Marty has friends, then maybe they could join in too!
Marty will start by taking a bow before learning to skip sideways, do a robot Highland fling and step (and maybe whoop) forwards and backwards. These moves can then be combined to form Marty's very own Scottish robot reel. Here is a video by one of our young coders!
If you are just looking for a quick activity, then jump straight into teaching Marty the dance steps and get reeling without delay!
what you will need
- A Scratch 3 compatible device
- Marty the Robot
- Optional: additional Marty the Robots - more robots dancing together, more fun!
What will you learn about?
- How to define and use blocks of code
- How to use parallel programming
extra information for educators
This activity can be linked to the concepts covered in lesson pack Programming Concepts 1.
Taking a Bow
The first part of every Scottish reel involves taking a formal bow. Our program with Marty will start the same way.
Create a new Scratch 3 project with the Marty the Robot extension added.
Program Marty to get ready.
Make a block can be found under the My Blocks section of our coding blocks.
Using My Blocks, we can define a block called bow and then make Marty stand straight.
Marty's feet and arms need to be correctly positioned to take a bow and start dancing. Firsty, we will turn Marty's feet out to 45 degrees. We want both feet to move at the same time so we will need parallel programming. This can be done using broadcasting, where we broadcast or send a message across our Scratch program to kick-start another set of blocks to run.
The broadcast blocks can be found under the Events section of our coding blocks.
Make a broadcast message called feet. Then we need run two different actions to move each foot! To do this we need to run our coding blocks in parallel - which means at the same time.
Just above where you found the broadcast block in the Events coding block drawer, you will see a when I receive message1 block. This block will run when we broadcast the message. All that is left to do is to have two of these events happening - once for the right foot and once for the left foot!
Now we can add arm movements in parallel with the feet movements.
We should have four events happening at the same time.
With feet and arms correctly positioned, it is time for Marty to lean forwards into the bow and then stand back up straight again ready to dance.
We need to add a wait while Marty's feet and arms move. Then Marty can lean forwards and then stand straight. The full bow block now looks like this:
Hint: If you want to make Marty's bow faster or slower, then adjust the timings!
Now that we have a basic bow happening, lets finally add some emotions into the movements to make our bow look more lifelike!
We can add emotion into our movements using Marty's eyebrows! Using the eyes block, when we click on the dropdown arrow then we get a list of options.
Try adding in some different eye movements during the bow. Here is an example,
Defining the dance steps
We now have a bow happening with some excited eyebrows to go along with the movement. The next step is make more blocks for each dance step. Some of our blocks will use parallel programming again to move arms and feet at the same time. Then we can put all of our blocks together so that Marty can do their very own robot reel.
A Scottish reel is a bit like a computer program! It is build from blocks of repeating steps often lasting for a count of eight beats of the music. Steps can be travelling steps that move you from place to place or setting steps where you dance on the spot. Marty is going to do both types.
The first dance block is a simple skip to the right for a count of eight beats. We will call this block skip right. Then we can define the second block in this pair. This is a block that makes Marty skip to the left for the same length of time called skip left.
Robot Highland Fling
The second pair of dance blocks are a bit more complicated. We will make Marty dance on the spot doing a step called a setting step. As this move makes Marty dance on the right foot first, we will call it dance right. For extra fun, we will add arm movements! Because we want both arms to be moving at the same time as the feet, we will use parallel programming again because we have three events. We will define our first block called dance right and broadcast a message right arm up. When the message is received, one event will make Marty raise the right arm, another event will lower the left arm and the third event will make Marty set to the right, to the left, to right and then stand straight.
Next we will define a block called dance left. This does the same set of movements as dance right but starting with the opposite foot and arm!
Step forwards and back
The third pair of dance blocks will make Marty move forwards then raise both arms at the same time. Because we want both arms to be moving at the same time, we will use parallel programming again because we have two events. We will define our first block called step forward and then make Marty take four steps, stand straight and broadcast a message to move both arms. When the message is received, each arm will move!
We will then make Marty step backwards and then lower both arms at the same time. Again, we want two events happening at the same time so will use the same parallel programming idea but we will broadcast a different message called both arms down. We will call this block step backwards.
Challenge: mAKING marty MAKE A NOISE in time with MOVING THE ARMS
We've already made two or more blocks of code run at the same. Can you make Marty's forwards and backwards dance steps even more exciting and make Marty make a noise each time the arms move up and down?
Add two extra blocks into our routine so that Marty makes a noise when the arms moves up and and again when the arms move down. Here are a few things you will need to think about,
- How can you make more blocks of code run at the same time? You'll need to use parallel programming for this!
- The timing of each movement so that the noise sounds in time with the arm movements
- You might want to broadcast a message to know when to start the noise
- What noise might Marty make? You might want a sound that increases in pitch!
- How long will the noise last for? You'll need to look at how long the arms move for!
I need some help!
We have used broadcasting, where we broadcast or send a message across our Scratch program which can kick-start another set of blocks to run in both our bow and our step forward and step backwards code blocks. The broadcast blocks can be found under the Events section of our coding blocks.
In our step forward block, we broadcast both arms up when we wanted each arm to start moving up.
We now want to add another block to play a sound when both arms up is received.
Just above where you found the broadcast block in the Events coding block drawer, you will see a when I receive message block. Use one of these blocks to receive the both arms up broadcast.
The, in the Marty the Robot coding block drawer, you will see play a sound block. The frequency of a sound is measured in units called Hz which is short for hertz. A low pitch sound has a low frequency so you need low number; a high pitch sound has a high frequency so you will need high number. We want Marty to make a sound that increases in frequency and lasts as long as it takes to move the arms. Beware though, if the numbers are too low or too high, we humans won't be able to hear the sounds (although dogs, bats and any passing whales might)!
Putting these two blocks together will make a noise that increases steadily in pitch over two seconds when both arms up is received.
So step forward now has three events - both arms moving and a noise!
We can then make a similar block to make a noise when the broadcast both arms down is received:
Finally, step backwards has three events - boths arms moving and a noise!
Hint: Try playing around with the frequencies of the two sounds!
The Robot Reel
We have our three pairs of dance blocks - skipping sideways (skip right and skip left), highland fling (dance right and dance left) and stepping (step forward and step backwards). Now we can have fun by putting them together!
Don't forget that Marty should bow at the start of the reel. A bow at the end would be good too!
Because all of the dance blocks last for eight counts, we can put them together in any order. We can add repeats if we want to do the same moves more than once.
Hint: Play around with different combinations of dance blocks to make your very own robot reel!
You have now just created and programmed your own Scotttish robot reel with Marty using Scratch. If you want to continue to explore blocks and parallel programming or how to continue to improve Marty's dancing, here are a few ideas!
- Adding more sounds and emotions to your moves. You could play different sounds in time with Marty doing different dance steps and make the eyebrows move in time to the dancing!
- Can you create your own dance move for Marty? Remember the keep the total time for the block the same as the other blocks! And remember each dance move should last for eight counts of any music!
- Dance in time to some music? You may need to adjust your timings if you want to make Marty dance faster or slower.
- If you have more than one Marty, can you make them robot reel together? You could make the Martys move in the same direction or you could experiment with them moving in different directions!