Scratch
Beginner
60 mins
Teacher/Student led
+65 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Crack the Code

Robo our robot has forgotten the secret code to his piggy bank, can you help him crack the code and get the money?

Lesson Files

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Create a new Scratch project

    Go to the Scratch website and create a new project. Delete the cat sprite as we don't need it.

    https://scratch.mit.edu

    We're going to create a project where you have to guess a two number code to open Robo the robot's piggy bank. If you guess it right Robo can get his money from his piggy bank.

    2 - Upload the backdrops

    We're going to use 2 different backdrops in our project, a piggy bank backdrop and a money backdrop.

    Save the two images that are included with this step onto your computer and then upload them as new backdrops into your project.



    3 - Add the Robot sprite

    Add the Robot sprite to your project from the sprite library.


    4 - Upload the Numbers-1 sprite

    There is a numbers sprite file included with this step called "Numbers-1.sprite3".

    Download it to your computer by right clicking on it and clicking "Save Link As...". Then once you've saved it to your computer, upload it into your Scratch project.

    This sprite has 4 costumes. One each for the numbers 1, 2, 3 and 4.

    A costume is one out of possibly many "frames" or different appearances of a sprite. Sprites can change their look to any of its costumes. They can be named, edited, created, and deleted, but every sprite must have at least one costume. One of the most common uses of costumes is to make an animation for a game or other project.

    5 - Set up the start

    At the start we should be showing the piggy back backdrop and the robot should also be showing (we'll be hiding him later).

    Add the following code to the Robot sprite.

    whenclickedswitchbackdroptocracod piggy bank start with this backdropshow show the robot


    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more