Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By : Michael Badger
Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By: Michael Badger

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – navigating back to the table of contents


After a scene plays out, we need to give our users a way to play the next scene. We'll do that by adding a home button on the scene. We're going to return to the table of contents and allow the user to select the next item. Let's add the controls:

  1. The Scratch sprite library includes several buttons we can use. For this exercise, I'm going to import Button3. You can use or create any button you like. Just add a text label that says Home via the paint editor and give the sprite a name, such as home button. Position the Home button on the top-left of the stage.

  2. From the Events palette, drag the when this sprite clicked block into the scripts area.

  3. Add a broadcast () block to the script and create a new message: Show TOC.

  4. Add the hide block.

  5. After we send the message to show the table of contents via the show TOC broadcast and hide the Home button, we need to switch the backdrop to the first stage backdrop. Add the switch backdrop to (backdrop1...