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 1.4: Beginner's Guide

You're reading from   Scratch 1.4: Beginner's Guide Learn to program while creating interactive stories, games, and multimedia projects using Scratch

Arrow left icon
Product type Paperback
Published in Jul 2009
Publisher Packt
ISBN-13 9781847196767
Length 264 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Programming concepts


With Scratch, we'll learn how to turn our imaginations into games, stories, and animations, and in the process, we'll learn some common programming concepts. If you're already a knowledgeable programmer, then you'll find out what Scratch has to offer your students.

The Scratch team publishes several resources to help educators, including a Programming Concepts guide, which I've summarized below:

Concept

Description

Program Design

When we design a program, we turn our imagination into something that can be shared with others. We create the flow of the program, the interface, and the actions each sprite takes to tell our story.

Loops (Iteration)

Loops iterate through a series of steps for as long as we tell the program to run the loop. We can use other programming concepts, such as conditional statements, to control the loop.

Conditional Statements

Check to see if a statement is true. For example, if 4 > 0 is a conditional statement.

Boolean Logic

Boolean logic operators include and, or, and not. If 4 > 0 and 4 > 1 is one example.

Variables

Variables store text or numbers for reuse in the program. They come in global and local types. For example, if x > 0 creates a conditional statement where x is 0, 1, 2, or anything else we define.

Arrays (Lists)

Arrays are similar to variables in that they store dynamic data. However, a list stores multiple values in the same way a grocery list stores a group of items.

Events

An action in the program prompts another part of the program to take an action. For example, when the Space bar is pressed, the sprite hides.

Synchronization and Coordination

Programming a sprite to receive a broadcast message from another sprite coordinates a cause and effect. Broadcasting a message and waiting for all the other sprites to act on the broadcast synchronizes the action.

Threads

Creating two scripts to run on the same control enables parallel execution. For example, programming four different sprites to pixelate when the flag (green in color) is clicked creates four threads.

Dynamic Interaction

Dynamic interaction provides real-time input into the Scratch program in order to manipulate the sprite in some way. For example, the position of the mouse is always known, so we can create a sprite that always follows the mouse position.

Random Numbers

Random numbers are picked from the range we specify.

Programming limitations

As of Scratch version 1.4, there are a few limitations with the language. As taken from Scratch's Programming Concepts guide, here are the concepts Scratch does not cover: functions, recursion, exception handling, file input/output, inheritance, parameter and return values, and defining classes of objects.

If that last paragraph sounds like gibberish, don't worry about it.

You have been reading a chapter from
Scratch 1.4: Beginner's Guide
Published in: Jul 2009
Publisher: Packt
ISBN-13: 9781847196767
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