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 2.0 Beginner's Guide: Second Edition

You're reading from   Scratch 2.0 Beginner's Guide: Second Edition Create digital stories, games, art, and animations through six unique projects.

Arrow left icon
Product type Paperback
Published in Apr 2014
Publisher
ISBN-13 9781782160724
Length 296 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Michael Badger Michael Badger
Author Profile Icon Michael Badger
Michael Badger
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Welcome to Scratch 2.0 FREE CHAPTER 2. A Quick Start Guide to Scratch 3. Creating an Animated Birthday Card 4. Creating a Scratch Story Book 5. Creating a Multimedia Slideshow 6. Making an Arcade Game – Breakout (Part I) 7. Programming a Challenging Gameplay – Breakout (Part II) 8. Chatting with a Fortune Teller 9. Turning Geometric Patterns into Art Using the Pen Tool A. Connecting a PicoBoard to Scratch 1.4 B. Pop Quiz Answers Index

Time for action – breaking out of the circle

Not all of our art needs to create a circle, and just to prove it, the following is a quick example:

  1. For this pattern, we'll use a variable called counter as both a way to control the number of times to repeat the pattern and a multiplier for the ever-changing x and y coordinates. Create the variable, if you don't have one in your current project.
  2. Set the initial values for the pattern as shown in the following set of blocks:
    • set (counter) to (0)
    • clear
    • hide
    • set pen size to (1)
  3. Add a repeat () until block and use the condition (counter) > (25) as the value. Repeat the following set of blocks:
    • pen up
    • go to x: ((counter) * (10) y: (0)
    • pen down
    • go to x: (0) y: (250) – ((counter) * (10))
    • change (counter) by (1)
  4. The resulting pattern should match the following screenshot:
    Time for action – breaking out of the circle

What just happened?

The key to this pattern is the use of the counter variable as a multiplier. The pattern starts at (0, 0) and moves right along the x axis in increments...

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