Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Scratch 2.0 Beginner's Guide: Second Edition
  • Table Of Contents Toc
Scratch 2.0 Beginner's Guide: Second Edition

Scratch 2.0 Beginner's Guide: Second Edition

By : Badger
4.3 (4)
close
close
Scratch 2.0 Beginner's Guide: Second Edition

Scratch 2.0 Beginner's Guide: Second Edition

4.3 (4)
By: Badger

Overview of this book

The book uses step-by-step instructions along with full code listings for each exercise. After each exercise, the author pauses to reflect, explain, and offer insights before building on the project. The author approaches the content with the belief that we are all teachers and that you are reading this book not only because you want to learn, but because you want to share your knowledge with others. Motivated students can pick up this book and teach themselves how to program because the book takes a simple, strategic, and structured approach to learning Scratch. Parents can grasp the fundamentals so that they can guide their children through introductory Scratch programming exercises. It’s perfect for homeschool families. Teachers of all disciplines from computer science to English can quickly get up to speed with Scratch and adapt the projects for use in the classroom.
Table of Contents (13 chapters)
close
close
12
Index

Time for action – enabling the user to create custom shapes

In this exercise, we're going to create variables and enable user-entered values via sliders:

  1. Create four variables named sides, length, angle, and pen size. This automatically adds a stage monitor for each variable.
  2. Hide the angle stage monitor. We're going to turn the other monitors into slider controls. Right-click on each monitor and select slider, as shown in the following screenshot:
    Time for action – enabling the user to create custom shapes
  3. Next, add a set () to block from the Data palette as the first block after the when (d) key pressed block. We want to calculate the angle of the shape by dividing 360 by sides. The set () to block becomes set (angle) to (360/sides).
  4. Add the sides reporter block to the repeat block.
  5. Add the length reporter block to the move () steps block.
  6. Add the angle reporter block to the turn () degrees block.
  7. Insert the set pen size to () block above pen down. Add the pen size block as the size value in set pen size to ().
  8. The script looks like the...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Scratch 2.0 Beginner's Guide: Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon