Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Scratch Cookbook

You're reading from   Scratch Cookbook If want to get your programming know-how off the starting blocks in a fun, involving way, then this guide to Scratch is perfect. In no time you'll be building your own interactive programs that include animations and sound.

Arrow left icon
Product type Paperback
Published in Jul 2013
Publisher Packt
ISBN-13 9781849518420
Length 262 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Brandon Milonovich Brandon Milonovich
Author Profile Icon Brandon Milonovich
Brandon Milonovich
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Scratch Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Scratch FREE CHAPTER 2. Storytelling 3. Adding Animation 4. Basic Gaming 5. Spicing up Games 6. Bringing in Sound 7. Integrating PicoBoards 8. Programming to Calculate 9. Project Remixing Collaboration Index

Objects disappearing


When we play the game we have created so far, we may want more to happen when the red bar hits a ball. Let's follow this recipe to make the ball disappear from the stage.

Getting ready

Continue with the game we've been making all along in this chapter. There isn't much we need to prepare, as long as you've been following the recipes up until now.

How to do it...

Apply the following to each bouncing ball sprite:

  1. Under the Looks category, find the hide block. Drag this to our script that controls bouncing off of the red bar.

  2. Under any of the green flag top hat blocks, drop a show block from the Looks category between the top hat block and the loop.

How it works...

By adding these two simple blocks we can make it so that each time the game starts, all of the bouncing balls are brought back on the stage. As soon as they touch the red bar, they will disappear for the remainder of the game.

You might notice, though, that the score will keep increasing. This is because those bouncing...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image