Learning Portal

Our hands-on, comprehensive lesson plans span a range of levels. Browse our free STEM and coding learning resources.

Marty Image

Egg and Spoon Race

Introduction

The egg and spoon race has been around for decades now, but this activity updates it with a modern twist! Instead of carrying the egg and spoon yourself, you must train Marty to complete the race as quickly as possible using code written in Scratch. If you are doing this activity alone you can compete against yourself to complete the race in the quickest time possible. Alternatively, if you have access to more than one Marty, you can compete with others to be the first to cross the finish line or cross the finish line in the shortest time if you are playing remotely!

Having tested the best way for a robot to carry an egg and spoon, Marty will be programmed to walk without using the built in walk command using Scratch. Once ready to take to the start line, it's a robot race to the finish as quickly as possible... don't drop the egg, Marty, or it will be back to the start!

What you will need

  • Scratch 3 compatible device with Wifi - a laptop or tablet
  • Marty the Robot (and more Martys if possible)
  • Materials to make an egg or an assortment of eggs such as small chocolate eggs, polystyrene eggs, hollow plastic eggs, ping-pong balls (be inventive!)
  • Plastic spoons big enough to hold your eggs
  • Stopwatch
  • Start and finish line markers

What will you learn about?

  • How to connect to program sequences of movements and use loops
  • How to change parameters to change Marty's walk
  • How to experiment with Marty's movement
  • How to fulfil a design brief for a game

Extra information for educators

This tutorial encourages students to think creatively with how to use Marty and apply their knowledge of how to make Marty move from Activity 2 (Teach Marty to Walk) through concepts of sequences of operations, parameters, and simple loops.

INSTRUCTIONS: Getting Started

We will start with the basics - opening a new Scratch 3 project ready for coding and testing eggs to see if they are suitable.

Create a new Scratch 3 project with the Marty the Robot extension added.

Getting Started with Scratch 3

If you have access to more than one Marty, divide into teams so that each team has access to a Marty and a programming device.

You can choose what to use for the "eggs". However, you'll need to make sure they are not too heavy or your Marty will nose dive into the ground before the race has begun! We recommend small chocolate eggs, polystyrene eggs, hollow plastic eggs or ping-pong balls but you can use anything you find works well or make your own egg. Check with a grown up before using anything that could get messy and damage your Marty.

Give each team a plastic spoon and "egg". You may need to test different eggs to see what works best!

Challenge: How does a robot hold an egg and spoon?

The first challenge is to attach the spoon to Marty and place the egg in it. You will know if you are successful if Marty doesn't drop the egg!

Here are a couple of things you will need to think about,

  • How does Marty move? Think about the motion of each body part !
  • Where is it best to attach the spoon? Marty’s hand? His mouth? His head?! His feet?!!!

INSTRUCTIONS: Making Marty move

Now would be a good time to remind yourself about what you did in Activity 2 (Teach Marty to Walk) as we are going to use the same coding ideas again.

Program Marty to walk without using the built in walk commands. For tips on the coding you can use, look at all the different ways you achieved this in Activity 2: Teach Marty to Walk.

I need some help!

Start by telling Marty to get ready.

This is a simple version of the code needed to make Marty walk without the built in command. It uses a forever loop to keep Marty walking.

Inside the forever loop are the Marty the Robot blocks needed to make Marty step to the right and then step to the left.

Hint: This code moves Marty's legs. If you want to move Marty's other body parts, then go ahead and experiment!!!

Once Marty has been trained, it’s race time! Line up your Marty ready to race on a start line and decide on a finish line. Get your stopwatch ready if you are going to time your race.

Ready...steady...GO!

Every time a Marty drops an egg they must return to the start line again.

The winner is the first Marty to cross the finish line with the egg still on their spoon or cross the finish line in the shortest time with the egg still on their spoon !

Challenge: Making Marty move Faster...

Now experiment with different speeds for Marty – you want Marty to walk as fast as possible without dropping the egg! If you're feeling brave you can also choose to alter the program used to make Marty take a step.

Change the blocks in our routine so that Marty moves faster. Here are some things you will need to think about,

  • You can change Marty's speed by changing the time each move takes. Experiment with the times - you want Marty to moves fast but not so fast that you drop the egg or Marty falls over!
  • Challenge yourself to write the code for Marty walking in a different way. Use the ideas about functions and variables from Activity 2!

I need some help!

Instead of using the code blocks that just moves Marty's legs backwards or forwards, you can control Marty's movements more carefully using this block:

Experiment with moving Marty's individual joint to different positions. You can also make the time for each move shorter if you dare!

Hint: There is no right or wrong answer to this challenge - just have fun trying to make Marty even speedier!

What Next?

You have now used Scratch to apply the code that makes Marty move without using the build-in walk block and have experimented with changing Marty's movement. If you want to continue to explore how to make Marty move, here are a few ideas! Have fun and let us know how you get on!

  • Can you come up with other popular Sports Day races for Marty to, erm, "run"?! You can use your code for this activity as a starting point!
  • Is sliding sideways a better way to win an Egg and Spoon race? Test this idea!
  • If the spoon is going to be held in Marty's hand, what is the best position for Marty's arm to keep the egg on the spoon? Experiment with different Marty arm positions to find the winning one!