Time Travel

ScratchEasy

In this lesson we will transport ourselves through time! By clicking on different characters we will find ourselves in 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).

Now add the following code to the 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



4

Create a variable called 'time'

We're going to create and use a variable named 'time' to set what time period to transport to and change the scene and characters based on that time.

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

when green flag clicked set [time v] to [now] // insert this block here switch costume to [dee-b v]

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.


6

Add a dinosaur sprite

We're going to transport to different time periods by clicking on particular sprites. The first time period we're going to code is the time when dinosaurs roamed the earth.

Add the 'Dinosaur2' sprite from the sprite library, drag it to the bottom left of the stage area and add this code to it:

when green flag clicked set size to [50] % when this sprite clicked set [time v] to [dinos] switch backdrop to [Jurassic v]



7

Add two more dinosaur sprites

Next we will add some dinosaur sprites from the sprite library that will be displayed in our Jurassic scene (and they will be hidden for any other scene).

Choose 2 dinosaur sprites from the library and add them. You will need to add the following code to both sprites.

when green flag clicked forever if <(time) = [dinos]> then show else hide end

Once you've added the code to both of these sprites, test it out by clicking on the green flag and the clicking on the 'Dinosaur2' sprite. The Jurassic backdrop with the 2 dinos should be showing.



8

Add more time periods!

Now that you've coded the first time period that you can transport to, add more time periods using the backdrop and sprite libraries.

For each time period you will need to:

  1. Add a backdrop from the backdrop library
  2. Add a sprite that will transport you when you click it
  3. Add sprites to appear when the above sprite is clicked

For example you could transport into the future by adding the following:

  • Backdrop library > Space City 1
  • Sprite library > Planet2
  • Sprite library > Kiran
  • Sprite library > Dot

Add the following code to the Panet2 sprite:

when this sprite clicked set [time v] to [future] switch backdrop to [Space City 1 v]

Add the following code to the both the Kiran and Dot sprites:

when green flag clicked forever if <(time) = [future]> then show else hide end


End of lesson
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