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 – creating an explosion


Let's draw a pattern, and then we'll completely change the pattern by changing a couple of key values. You don't have to, but I'm going to start with a new project.

  1. Create a variable named counter. Let's initialize our script with the following set of blocks:

    • clear

    • go to x: (0) y: (0)

    • set (counter) to (1)

    • pen down

  2. Add a repeat () block and change the value to 125.

  3. Repeat the following set of blocks:

    • move ((counter) * (2)) steps

    • turn (204) degrees

    • change (counter) by (1)

  4. Next, finish the script by adding the pen up block outside the loop.

  5. Check your script against the following screenshot, and then draw the shape:

  6. First, remove the (counter) * (2) block from the move () steps block. Then change the value in the move () steps block to 100, and draw the shape.

  7. Now put the (counter) * (2) block back into in the move () steps block. Then change the value in the turn () block to 185, and draw the shape.

  8. The following screenshot shows the three patterns we...