Front cover image for Scratch programming for teens

Scratch programming for teens

This tool is intended to make programming easier to learn for novice programmers and can be used to create computer games, interactive stories, graphic artwork, computer animation and other multimedia projects
Print Book, English, ©2009
Course Technology, Boston, MA, ©2009
xix, 315 pages : illustrations ; 24 cm + 1 CD-ROM (4 3/4 in.)
9781598635362, 1598635360
192082761
Introductionxiv
PART I SCRATCH BASICS
1(94)
Introducing Scratch
3(24)
Getting to Know Scratch
4(4)
Imagine---Program---Share!
5(1)
Scratch Uncovered
6(1)
Scratch's Building Block Approach to Programming
6(2)
Installing scratch
8(6)
Installing Java on Windows
9(1)
Installing Scratch on Windows
10(2)
Installing Scratch on Mac OS X
12(2)
Creating Your First Scratch Application
14(5)
Creating a New Scratch Project
15(1)
Changing Sprite Attributes
16(1)
Adding Code Blocks
16(2)
Saving Your Work
18(1)
Joining Scratch's Global Community
19(7)
Sharing Your Application Projects
21(2)
Registering with the Scratch Website
23(1)
Keeping In Touch
24(2)
Summary
26(1)
Getting Comfortable with the Scratch Development Environment
27(26)
Getting Comfortable with the Scratch IDE
28(18)
Getting Familiar with Menu Bar Commands
29(2)
Running Scratch Applications on the Stage
31(2)
Running Applications in Presentation Mode
33(1)
Controlling Application Execution
33(1)
Working with the Sprite List
34(1)
Generating New Sprites
35(1)
Tracking Mouse Pointer Location
36(1)
Working with the Scratch Toolbar
37(1)
Switching Between Code Block Groups
38(1)
Getting Comfortable with the Scripts Area
38(6)
Keeping Project Notes
44(2)
Creating New Sprites Using Scratch's Paint Editor
46(5)
Examining the Drawing Canvas
46(1)
Working with the Toolbar and Options Area
47(2)
Working with Button Controls
49(1)
Specifying Color Settings
50(1)
Configuring a Sprite's Rotation Center
50(1)
Summary
51(2)
A Review of the Basic Components of Scratch Projects
53(20)
Working with Blocks and Stacks
53(2)
Three Basic Types of Scratch Blocks
55(3)
Working with Stack Blocks
55(2)
Working with Hat Blocks
57(1)
Working with Reporter Blocks
57(1)
Keeping an Eye Out with Monitors
58(2)
Eight Categories of Scratch Blocks
60(10)
Moving Objects Around the Drawing Canvas
61(1)
Changing Object Appearance
62(1)
Making Some Noise
63(1)
Drawing Lines and Shapes
64(1)
Looping, Conditional Logic, and Event Programming
65(1)
Sensing Sprite Location and Environmental Input
65(2)
Working with Numbers
67(1)
Storing and Retrieving Data
67(3)
Getting Help with Code Blocks
70(1)
Summary
71(2)
Mr. Wiggly's Dance---A Quick Scratch Project
73(22)
Programming with Scratch
73(2)
Creating the Mr. Wiggly's Dance Application
75(16)
Step 1: Creating a New Scratch Project
77(1)
Step 2: Adding a Background to the Stage
77(3)
Step 3: Adding and Removing Sprites
80(2)
Step 4: Adding Mr. Wiggly's Music
82(3)
Step 5: Playing the Dance Music
85(2)
Step 6: Making Mr. Wiggly Dance
87(3)
Step 7: Saving and Executing Your New Scratch Application
90(1)
Distributing Scratch Projects
91(3)
Distributing Scratch Applications to Windows Computers
92(1)
Distributing Scratch Applications to Mac OS X Computers
93(1)
Instructions for Executing Your Application from a CD-ROM
93(1)
Summary
94(1)
PART II LEARNING HOW TO WRITE SCRATCH PROGRAMS
95(154)
Moving Things Around
97(22)
Working with Motion Code Blocks
98(1)
Moving and Rotating Sprites
98(3)
Setting Sprite Direction
101(2)
Repositioning a Sprite
103(2)
Changing Sprite Coordinates
105(1)
Bouncing Sprites Around the Stage
105(1)
Keeping Track of Sprite Coordinates and Direction
106(1)
Taking Advantage of Scratch Cards
107(3)
Creating the Virtual Scratch Fish Tank
110(7)
Step 1: Creating a New Scratch Project
111(1)
Step 2: Adding a Background to the Stage
111(1)
Step 3: Adding and Removing Sprites
111(1)
Step 4: Adding a Suitable Audio File to the Stage
112(1)
Step 5: Playing the Audio File
113(1)
Step 6: Animating the Swimming of the Fish
113(3)
Step 7: Saving and Executing Your New Scratch Application
116(1)
Summary
117(2)
Sensing Sprite Position and Controlling Environmental Settings
119(20)
Working with Sensing Code Blocks
120(1)
Retrieving Mouse Button and Coordinate Status
121(2)
Determining when Keys Are Pressed
123(1)
Determining when Sprites Collide with Other Objects
124(3)
Determining Distance
127(1)
Working with a Timer
128(1)
Retrieving Stage and Sprite Data
129(1)
Retrieving Audio Data
130(1)
Code Blocks That Work with Sensor Boards
131(1)
Creating the Family Scrapbook Application
132(5)
Step 1: Creating a New Scratch Project
132(1)
Step 2: Adding and Removing Sprites and Costumes
133(1)
Step 3: Adding a Suitable Audio File to the Stage
134(1)
Step 4: Playing the Audio File
135(1)
Step 5: Displaying the Photographs
135(1)
Step 6: Saving and Executing Your New Scratch Application
136(1)
Summary
137(2)
Storing and Retrieving Data
139(20)
Learning How to Work with Application Data
139(2)
Storing Data in Variables
141(4)
Creating Scratch Variables
141(1)
Assigning Variables to Sprites and the Stage
142(1)
Assigning Names to Your Variables
143(1)
Understanding Variable Scope
143(2)
Deleting Variables when They Are No Longer Needed
145(1)
Accessing Variables Belonging to Other Sprites
145(2)
Working with Variable Monitors
147(1)
Two Quick Examples
147(1)
Developing the Basketball Quiz Project
148(10)
Step 1: Creating a New Scratch Project
150(1)
Step 2: Selecting an Appropriate Stage Background
150(1)
Step 3: Adding and Removing Sprites
150(1)
Step 4: Adding Variables Required by the Application
151(2)
Step 5: Adding Scripts to Button Sprites to Collect User Input
153(1)
Step 6: Automating the Administration of the Quiz
154(3)
Step 7: Saving and Executing Your New Application
157(1)
Summary
158(1)
Doing a Little Math
159(18)
Addition, Subtraction, Multiplication, and Division
159(1)
Understanding the Mathematical Order of Precedence
160(1)
Generating a Random Number
161(1)
Comparison Operations
162(4)
Performing Logical Comparisons
166(1)
Rounding Numbers and Retrieving Remainders
167(1)
Working with Built-in Mathematical Functions
168(1)
Developing the Number Guessing Game Quiz Project
169(7)
Step 1: Creating a New Scratch Project
171(1)
Step 2: Adding a Stage Background
171(1)
Step 3: Adding and Removing Sprites
171(1)
Step 4: Adding Variables Required by the Application
172(1)
Step 5: Adding an Audio File to the Application
173(1)
Step 6: Adding Scripts to Capture Player Input
173(1)
Step 7: Processing Player Guesses
174(2)
Step 8: Saving and Executing Your New Scratch Application
176(1)
Summary
176(1)
Conditional and Repetitive Logic
177(20)
Introducing Scratch Control Blocks
177(1)
Event Programming
178(1)
Pausing Script Execution
179(1)
Executing Loops
180(3)
Sending and Receiving Broadcasts
183(1)
Conditional Programming Logic
184(3)
Nesting Conditional Control Code Blocks
186(1)
Preventing Endless Loops
186(1)
Terminating Script Execution
187(1)
Developing the Ball Chase Game
188(7)
Step 1: Creating a New Scratch Project
189(1)
Step 2: Adding and Removing Sprites
189(2)
Step 3: Adding Variables Required by the Application
191(1)
Step 4: Adding an Audio File to the Application
191(1)
Step 5: Adding a Script to Control Ball Movement
191(1)
Step 6: Adding Scripts That Display Game Over Messages
192(1)
Step 7: Adding Scripts Needed to Control and Coordinate Game Play
192(3)
Step 8: Saving and Executing Your Scratch Project
195(1)
Summary
195(2)
Changing the Way Sprites Look and Behave
197(16)
Changing Sprite Costumes and Backgrounds
198(3)
Changing Sprite Costumes
198(2)
Changing a Stage's Background Costumes
200(1)
Making Sprites Talk and Think
201(1)
Applying Special Effects to Costumes and Backgrounds
202(2)
Changing a Sprite's Size
204(1)
Making Sprites Appear and Disappear
205(1)
Determining What Happens when Two Sprites Overlap
206(1)
Developing the Crazy Eight Ball Game
207(5)
Step 1: Creating a New Scratch Project
209(1)
Step 2: Adding and Removing Sprites
209(1)
Step 3: Adding a Variable Required by the Application
210(1)
Step 4: Adding an Audio file to the Application
210(1)
Step 5: Creating a Script to Control the Display of the 8 in the Eight Ball
210(1)
Step 6: Adding the Programming Logic Needed to Control the Eight Ball
211(1)
Step 7: Saving and Executing Your Scratch Project
212(1)
Summary
212(1)
Spicing Things Up with Sounds
213(18)
Playing Sounds
214(2)
Play a Drum
216(1)
Playing Musical Notes
217(2)
Configuring Audio Volume
219(1)
Setting and Changing Tempo
220(1)
Creating the Family Picture Movie
221(9)
Step 1: Creating a New Scratch Project
222(1)
Step 2: Adding and Removing Sprites and Backgrounds
223(2)
Step 3: Adding a Variable Required by the Application
225(1)
Step 4: Adding an Audio File to the Application
225(1)
Step 5: Developing the Application's Programming Logic
226(4)
Step 6: Saving and Executing Your Scratch Project
230(1)
Summary
230(1)
Drawing Lines and Shapes
231(18)
Clearing the Stage Area
231(1)
Drawing with the Pen
232(2)
Setting Pen Color
234(2)
Changing Pen Shade
236(2)
Working with Different Size Pens
238(1)
Stamping an Instance of a Costume on the Stage
239(1)
Creating the Doodle Drawing Application
240(7)
Step 1: Creating a New Scratch Project
241(1)
Step 2: Adding and Removing Sprites
242(2)
Step 3: Creating Scripts Used to Control the Doodle Drawing Application
244(3)
Step 4: Saving and Executing Your Scratch Project
247(1)
Summary
247(2)
PART II ADVANCED TOPICS
249(44)
Sharing Your Scratch Projects over the Internet
251(16)
Running Scratch Applications on the Internet
251(1)
Registering with the Scratch Website
252(2)
Uploading Your Scratch Applications
254(3)
Viewing and Organizing Your Applications Online
257(8)
Running Your Application
257(1)
Adding Comments
257(2)
Adding Tags
259(1)
Creating Galleries
260(4)
Removing Projects
264(1)
Updating Your Projects
264(1)
Other Scratch Website Features
264(1)
Downloading Other People's Projects
265(1)
Summary
266(1)
Collecting External Input Using a Scratch Board
267(10)
Interacting with the Real World
268(1)
Buying a Scratch Board
269(1)
Installing Your Scratch Board
269(1)
Using the Sensor Block to Interact with Your Scratch Board
270(6)
Collecting Input Using the Slider Control
270(2)
Using the Button Control to Initiate Action
272(1)
Reacting to Light
272(1)
Responding to Sound
273(1)
Measuring Electrical Resistance
274(1)
Keeping a Watchful Eye on Sensor Data
275(1)
Summary
276(1)
Finding and Fixing Program Errors
277(16)
Dealing with Application Errors
277(4)
Understanding Syntax Errors
279(1)
Keeping an Eye Out for Logical Errors
279(1)
Tracking Down Run-Time Errors
280(1)
Debugging Your Scratch Applications
281(6)
Basic Debugging Techniques
281(3)
Running Your Application in Single Stepping Mode
284(3)
Watch Out when Removing Sounds and Sprites
287(1)
Getting Help
288(4)
Referring to Scratch's Online Help
289(1)
Getting Help for Individual Code Blocks
289(2)
Getting Help from Other Scratch Programmers
291(1)
Summary
292(1)
PART IV APPENDICES
293(10)
Appendix A What's on the Companion CD?
295(2)
Appendix B What Next?
297(6)
Glossary303(4)
Index307
Accompanying CD-ROM contains Scratch installation files and source code for projects described in book
Includes index