Coding Ireland STEM Report 2024 Have Your Say
Scratch
Intermediate
60 mins
220 points
What you need:
  • Computer/laptop

Time Travel

In this lesson we will transport ourselves through time! By clicking on different characters we will find ourselves surrounded by dinosaurs or looking at a space city!

1 - Create a new Scratch project

Create a new Scratch project and delete the cat sprite.

2 - Add the hall backdrop

We'll start off in modern times so add the 'Hall' backdrop from the backdrop library (as this is a modern scene).


3 - Add the boy sprite

Add the sprite called 'Dee' from the sprite library.

Drag the sprite to the left of the stage area (by holding down the left mouse button and moving your mouse).

Dee will say some instructions at the start. He will tell us how to transport to different time periods.

Add the following code to the Dee sprite:

when green flag clicked switch costume to [dee-b v] switch backdrop to [Hall v] say [Hi I'm Dee and I have a time travel machine!] for [4] secs say [Click on one of the items below to transport to that time!] for [4] secs

As there is a lot of text to put in for what the character will say, it's a good idea to learn how to copy and paste text as this will save you a lot of time!

How to copy and paste text:

  1. Select the text you wish to copy by pointing your mouse just to the left of it, holding down the left mouse button and moving your mouse to select the text then release the left mouse button.
  2. Once your text is selected it should appear highlighted.
  3. Now hold down the 'Ctrl' button and press the 'C' button once. This will copy your text into your computer's memory.
  4. Click into the textbox you wish to paste your text.
  5. Hold down the 'Ctrl' button and press the 'V' button once. This will paste in your copied text.


4 - Create a variable called 'time'

We're going to create and use a variable called 'time' to set what time period to transport to. When we choose a time period, we will set the value of the 'time' variable and that will change the scene and characters based to that chosen time period.

After you create the variable, add the set [time] to now block to the boy sprite, underneath the when clicked block.

when green flag clicked set [time v] to [now] // insert this block here switch costume to [dee-b v] switch backdrop to [Hall v] say [Hi I'm Dee and I have a time travel machine!] for [4] secs say [Click on one of the items below to transport to that time!] for [4] secs


5 - Add a Jurassic backdrop

Our first time period will be the time the dinosaurs roamed the earth! Add the 'Jurassic' backdrop from the backdrop library.


Join our club 😃

To view the remaining 3 steps and access hundreds of other coding projects please login or create an account.

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