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 – decreasing the paddle size based on the clones' costume


We have three main tasks. We need to create a smaller costume for the paddle, create the script to keep track of how many times the ball touches the brick's yellow costume, and then build the script that changes the paddle's costume.

To detect the yellow costume of the brick, we have multiple solutions available to us. However, we're going to pick a slightly more complicated solution because it offers us more flexibility for future enhancements. We'll revisit some alternatives after we work through the exercise. The steps are as follows:

  1. Let's start with the paddle first. Duplicate the existing paddle costume and then use the eraser tool to make the costume smaller. Let's name the costumes something meaningful, such as big and small.

  2. While we're thinking about it, let's ensure our game always starts with the big paddle costume visible. Create a when flag clicked stack for the paddle and add the switch costume to (big...