Scratch tm Programming for Teens



Similar documents
BaanERP. BaanERP Windows Client Installation Guide

Desktop Management. Desktop Management Tools

Domain 1: Identifying Cause of and Resolving Desktop Application Issues Identifying and Resolving New Software Installation Issues

(VCP-310)

ODBC. Getting Started With Sage Timberline Office ODBC

Configuring Additional Active Directory Server Roles

Professional Networking

Domain 1: Configuring Domain Name System (DNS) for Active Directory

Ideate, Inc. Training Solutions to Give you the Leading Edge

Domain 1: Designing a SQL Server Instance and a Database Solution

Baan Service Master Data Management

PUBLIC RELATIONS PROJECT 2016

A guide to School Employees' Well-Being

CS100: Introduction to Computer Science

Flood Emergency Response Plan

CCH Accountants Starter Pack

E-Plex Enterprise Access Control System

Engineering Data Management

insight reporting solutions

Serial ATA PCI Host Adapter AEC-6290/6295

iprox sensors iprox inductive sensors iprox programming tools ProxView programming software iprox the world s most versatile proximity sensor

Agenda. Outsourcing and Globalization in Software Development. Outsourcing. Outsourcing here to stay. Outsourcing Alternatives

CREATIVE MARKETING PROJECT 2016

TruStore: The storage. system that grows with you. Machine Tools / Power Tools Laser Technology / Electronics Medical Technology

How to use what you OWN to reduce what you OWE

WindWise Education. 2 nd. T ransforming the Energy of Wind into Powerful Minds. editi. A Curriculum for Grades 6 12

Bio-Plex Manager Software

CCH Accounts Production

CCH CRM Books Online Software Fee Protection Consultancy Advice Lines CPD Books Online Software Fee Protection Consultancy Advice Lines CPD

client communication

One Goal. 18-Months. Unlimited Opportunities.

Hypergeometric Distributions

The Importance of Media in the Classroom

IT Support n n support@premierchoiceinternet.com. 30 Day FREE Trial. IT Support from 8p/user

Conversion Instructions:

AGC s SUPERVISORY TRAINING PROGRAM

Modified Line Search Method for Global Optimization

GOOD PRACTICE CHECKLIST FOR INTERPRETERS WORKING WITH DOMESTIC VIOLENCE SITUATIONS

Confidence Intervals for One Mean

The Forgotten Middle. research readiness results. Executive Summary

Conclusions. Chapter 9

Domain 1 Components of the Cisco Unified Communications Architecture

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Analyzing Longitudinal Data from Complex Surveys Using SUDAAN

Radio Dispatch Systems

Digital Enterprise Unit. White Paper. Web Analytics Measurement for Responsive Websites

Lesson Plans for Teachers

INDEPENDENT BUSINESS PLAN EVENT 2016

Chapter 10 Computer Design Basics

facing today s challenges As an accountancy practice, managing relationships with our clients has to be at the heart of everything we do.

Neolane Leads. Neolane v6.1

InventoryControl. The Complete Inventory Tracking Solution for Small Businesses

Setting Up a Contract Action Network

Measures of Spread and Boxplots Discrete Math, Section 9.4

HP Asset Manager. Software version: Service Asset and Configuration Management

Neolane Reporting. Neolane v6.1

Authentication - Access Control Default Security Active Directory Trusted Authentication Guest User or Anonymous (un-authenticated) Logging Out

ContactPro Desktop for Multi-Media Contact Center

The Big Picture: An Introduction to Data Warehousing

In nite Sequences. Dr. Philippe B. Laval Kennesaw State University. October 9, 2008

Dragon NaturallySpeaking. Version User Guide

Mathematical goals. Starting points. Materials required. Time needed

Did you know that houses with CCTV are 90% less likely to be burgled? Yale now offer a range of Easy Fit CCTV systems

STUDENTS PARTICIPATION IN ONLINE LEARNING IN BUSINESS COURSES AT UNIVERSITAS TERBUKA, INDONESIA. Maya Maria, Universitas Terbuka, Indonesia

Pre-Suit Collection Strategies

CCH Practice Management

Week 3 Conditional probabilities, Bayes formula, WEEK 3 page 1 Expected value of a random variable

Making training work for your business

BaanERP 5.0c. EDI User Guide

Security Functions and Purposes of Network Devices and Technologies (SY0-301) Firewalls. Audiobooks

INVESTMENT PERFORMANCE COUNCIL (IPC) Guidance Statement on Calculation Methodology

OfficePACS. Digital Imaging

G r a d e. 2 M a t h e M a t i c s. statistics and Probability

2014 Menu of Agency Support Services 17 TOP OF MIND TOUCH POINTS

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Free Captioned Telephone Services

RELEASE GUIDE. VirusScan Enterprise VERSION 7.0

leasing Solutions We make your Business our Business

Now here is the important step

6. p o s I T I v e r e I n f o r c e M e n T

3G Security VoIP Wi-Fi IP Telephony Routing/Switching Unified Communications. NetVanta. Business Networking Solutions

Appendix B: Third-Party Tools

Commercial Real Estate Women Network

Total Program Management for High-Tech

Handling. Collection Calls

auction a guide to buying at Residential

Information for Programs Seeking Initial Accreditation

The Canadian Council of Professional Engineers

Building Enterprise Applications with Windows Presentation Foundation and the Model View ViewModel Pattern

Equalizer Installation and Administration Guide

WHERE CHANGE IS POSSIBLE

Agency Relationship Optimizer

QUADRO tech. PST Flightdeck. Put your PST Migration on autopilot

The Official Joomla! Book. Second Edition

CS100: Introduction to Computer Science

This publication was written by the staff of the College Information Services office

Domain 1 - Describe Cisco VoIP Implementations

NBX Business Telephone Guide

PUBLIC RELATIONS PROJECT 2015

Transcription:

Scratch tm Programmig for Tees Jerry Lee Ford, Jr. Course Techology PTR A part of Cegage Learig Australia. Brazil. Japa. Korea. Mexico. Sigapore. Spai. Uited Kigdom. Uited States

Scratch TM Programmig for Tees Jerry Lee Ford, Jr. Publisher ad Geeral Maager, Course Techology PTR: Stacy L. Hiquet Associate Director of Marketig: Sarah Paella Maager of Editorial Services: Heather Talbot Marketig Maager: Mark Hughes Acquisitios Editor: Mitzi Kootz Project Editor: Jey Davidso Techical Reviewer: Parker Hiquet Tee Reviewer: Haah Wittig PTR Editorial Services Coordiator: Eri Johso Iterior Layout Tech: ICC Macmilla Ic. Cover Desiger: Mike Taamachi CD-ROM Producer: Brado Peticuff Idexer: Sharo Shock Proofreader: Gee Reddig 2009 Course Techology, a part of Cegage Learig. ALL RIGHTS RESERVED. No part of this work covered by the copyright herei may be reproduced, trasmitted, stored, or used i ay form or by ay meas graphic, electroic, or mechaical, icludig but ot limited to photocopyig, recordig, scaig, digitizig, tapig, Web distributio, iformatio etworks, or iformatio storage ad retrieval systems, except as permitted uder Sectio 107 or 108 of the 1976 Uited States Copyright Act, without the prior writte permissio of the publisher. For product iformatio ad techology assistace, cotact us at Cegage Learig Customer & Sales Support, 1-800-354-9706 For permissio to use material from this text or product, submit all requests olie at cegage.com/permissios Further permissios questios ca be e-mailed to permissiorequest@cegage.com Scratch is a project of the Lifelog Kidergarte group at the MIT Media Lab. Scratch, the Scratch logo, ad the Scratch cat are trademarks of the Massachusetts Istitute of Techology. All other trademarks are the property of their respective owers. Library of Cogress Cotrol Number: 2008902386 ISBN-13: 978-1-59863-536-2 ISBN-10: 1-59863-536-0 eisbn-10:1-59863-699-5 Course Techology 25 Thomso Place Bosto, MA 02210 USA Cegage Learig is a leadig provider of customized learig solutios with office locatios aroud the globe, icludig Sigapore, the Uited Kigdom, Australia, Mexico, Brazil, ad Japa. Locate your local office at: iteratioal.cegage.com/regio Cegage Learig products are represeted i Caada by Nelso Educatio, Ltd. For your lifelog learig solutios, visit courseptr.com Visit our corporate website at cegage.com Prited i Caada 1234567111009

To my mother ad father for always beig there, ad to my woderful childre, Alexader, William, ad Molly, ad my beautiful wife, Mary.

Ackowledgmets There are a umber of idividuals to whom I owe may thaks for their help ad assistace i the developmet of this book. For starters I eed to thak Mitzi Kootz who served as the book s acquisitios editor. Special thaks also go out to Jey Davidso for servig as the book s project editor. I also wat to thak Parker Hiquet ad Haah Wittig for all the valuable iput ad advice. I additio, I would like to thak everyoe else at Cegage Learig for all their hard work. Special thaks to the Scratch developmet team at the MIT Media Lab for providig such a excellet programmig lagauge ad website.

About the Author Jerry Lee Ford, Jr. is a author, educator, ad a IT professioal with over 18 years experiece i iformatio techology, icludig roles as a automatio aalyst, techical maager, techical support aalyst, automatio egieer, ad security aalyst. He is the author of 24 other books ad co-author of two additioal books. His published works iclude AppleScript Studio Programmig for the Absolute Begier, Microsoft Widows PowerShell Programmig for the Absolute Begier, Microsoft Visual Basic 2005 Express Editio Programmig for the Absolute Begier, Microsoft VBScript Professioal Projects, Microsoft Widows Shell Scriptig ad WSH Admiistrator s Guide, Microsoft Widows Shell Script Programmig for the Absolute Begier, Lear JavaScript i a Weeked, Secod Editio, ad Microsoft Widows XP Professioal Admiistrator s Guide.Jerryhas a master s degree i busiess admiistratio from Virgiia Commowealth Uiversity i Richmod, Virgiia, ad he has over five years experiece as a adjuct istructor teachig etworkig courses i iformatio techology.

Cotets Itroductio......................................... xiv PART I SCRATCH BASICS...... 1 Chapter 1 Itroducig Scratch.... 3 Gettig to Kow Scratch................................. 4 Imagie Program Share!............................ 5 Scratch Ucovered................................... 6 Scratch s Buildig Block Approach to Programmig.......... 6 Istallig Scratch...................................... 8 Istallig Java o Widows............................ 9 Istallig Scratch o Widows......................... 10 Istallig Scratch o Mac OS X......................... 12 Creatig Your First Scratch Applicatio..................... 14 Creatig a New Scratch Project........................ 15 Chagig Sprite Attributes............................ 16 Addig Code Blocks................................. 16 Savig Your Work.................................. 18 Joiig Scratch s Global Commuity....................... 19 Sharig Your Applicatio Projects...................... 21 Registerig with the Scratch Website.................... 23 Keepig I Touch.................................. 24 Summary........................................... 26 vi

Cotets vii Chapter 2 Gettig Comfortable with the Scratch Developmet Eviromet... 27 Gettig Comfortable with the Scratch IDE................... 28 Gettig Familiar with Meu Bar Commads............... 29 Ruig Scratch Applicatios o the Stage................ 31 Ruig Applicatios i Presetatio Mode............... 33 Cotrollig Applicatio Executio...................... 33 Workig with the Sprite List.......................... 34 Geeratig New Sprites.............................. 35 Trackig Mouse Poiter Locatio....................... 36 Workig with the Scratch Toolbar...................... 37 Switchig Betwee Code Block Groups................... 38 Gettig Comfortable with the Scripts Area................ 38 Keepig Project Notes............................... 44 Creatig New Sprites Usig Scratch s Pait Editor............. 46 Examiig the Drawig Cavas........................ 46 Workig with the Toolbar ad Optios Area.............. 47 Workig with Butto Cotrols......................... 49 Specifyig Color Settigs............................. 50 Cofigurig a Sprite s Rotatio Ceter................... 50 Summary........................................... 51 Chapter 3 A Review of the Basic Compoets of Scratch Projects.. 53 Workig with Blocks ad Stacks.......................... 53 Three Basic Types of Scratch Blocks........................ 55 Workig with Stack Blocks............................ 55 Workig with Hat Blocks............................. 57 Workig with Reporter Blocks......................... 57 Keepig a Eye Out with Moitors........................ 58 Eight Categories of Scratch Blocks......................... 60 Movig Objects Aroud the Drawig Cavas.............. 61 Chagig Object Appearace.......................... 62 Makig Some Noise................................. 63 Drawig Lies ad Shapes............................ 64 Loopig, Coditioal Logic, ad Evet Programmig........ 65 Sesig Sprite Locatio ad Evirometal Iput........... 65 Workig with Numbers.............................. 67 Storig ad Retrievig Data........................... 67 Gettig Help with Code Blocks........................... 70 Summary........................................... 71

viii Cotets Chapter 4 Mr. Wiggly s Dace A Quick Scratch Project..... 73 Programmig with Scratch.............................. 73 Creatig the Mr. Wiggly s Dace Applicatio................ 75 Step 1: Creatig a New Scratch Project................... 77 Step 2: Addig a Backgroud to the Stage................ 77 Step 3: Addig ad Removig Sprites.................... 80 Step 4: Addig Mr. Wiggly s Music...................... 82 Step 5: Playig the Dace Music........................ 85 Step 6: Makig Mr. Wiggly Dace...................... 87 Step 7: Savig ad Executig Your New Scratch Applicatio... 90 Distributig Scratch Projects............................. 91 Distributig Scratch Applicatios to Widows Computers..... 92 Distributig Scratch Applicatios to Mac OS X Computers..... 93 Istructios for Executig Your Applicatio from a CD-ROM... 93 Summary........................................... 94 PART II LEARNING HOW TO WRITE SCRATCH PROGRAMS... 95 Chapter 5 Movig Thigs Aroud... 97 Workig with Motio Code Blocks........................ 98 Movig ad Rotatig Sprites............................ 98 Settig Sprite Directio................................ 101 Repositioig a Sprite................................ 103 Chagig Sprite Coordiates............................ 105 Boucig Sprites Aroud the Stage....................... 105 Keepig Track of Sprite Coordiates ad Directio........... 106 Takig Advatage of Scratch Cards....................... 107 Creatig the Virtual Scratch Fish Tak..................... 110 Step 1: Creatig a New Scratch Project.................. 111 Step 2: Addig a Backgroud to the Stage............... 111 Step 3: Addig ad Removig Sprites................... 111 Step 4: Addig a Suitable Audio File to the Stage......... 112 Step 5: Playig the Audio File........................ 113 Step 6: Aimatig the Swimmig of the Fish............. 113 Step 7: Savig ad Executig Your New Scratch Applicatio.. 116 Summary.......................................... 117 Chapter 6 Sesig Sprite Positio ad Cotrollig Evirometal Settigs..... 119 Workig with Sesig Code Blocks....................... 120 Retrievig Mouse Butto ad Coordiate Status............. 121 Determiig whe Keys Are Pressed...................... 123

Cotets ix Determiig whe Sprites Collide with Other Objects......... 124 Determiig Distace................................. 127 Workig with a Timer................................ 128 Retrievig Stage ad Sprite Data........................ 129 Retrievig Audio Data................................ 130 Code Blocks That Work with Sesor Boards................. 131 Creatig the Family Scrapbook Applicatio................. 132 Step 1: Creatig a New Scratch Project.................. 132 Step 2: Addig ad Removig Sprites ad Costumes........ 133 Step 3: Addig a Suitable Audio File to the Stage......... 134 Step 4: Playig the Audio File........................ 135 Step 5: Displayig the Photographs.................... 135 Step 6: Savig ad Executig Your New Scratch Applicatio.. 136 Summary.......................................... 137 Chapter 7 Storig ad Retrievig Data... 139 Learig How to Work with Applicatio Data............... 139 Storig Data i Variables.............................. 141 Creatig Scratch Variables........................... 141 Assigig Variables to Sprites ad the Stage............. 142 Assigig Names to Your Variables.................... 143 Uderstadig Variable Scope........................ 143 Deletig Variables whe They Are No Loger Needed......... 145 Accessig Variables Belogig to Other Sprites.............. 145 Workig with Variable Moitors......................... 147 Two Quick Examples.................................. 147 Developig the Basketball Quiz Project.................... 148 Step 1: Creatig a New Scratch Project.................. 150 Step 2: Selectig a Appropriate Stage Backgroud........ 150 Step 3: Addig ad Removig Sprites................... 150 Step 4: Addig Variables Required by the Applicatio...... 151 Step 5: Addig Scripts to Butto Sprites to Collect User Iput....................................... 153 Step 6: Automatig the Admiistratio of the Quiz........ 154 Step 7: Savig ad Executig Your New Applicatio........ 157 Summary.......................................... 158 Chapter 8 Doig a Little Math... 159 Additio, Subtractio, Multiplicatio, ad Divisio........... 159 Uderstadig the Mathematical Order of Precedece........ 160 Geeratig a Radom Number.......................... 161

x Cotets Compariso Operatios............................... 162 Performig Logical Comparisos......................... 166 Roudig Numbers ad Retrievig Remaiders.............. 167 Workig with Built-i Mathematical Fuctios.............. 168 Developig the Number Guessig Game Quiz Project......... 169 Step 1: Creatig a New Scratch Project.................. 171 Step 2: Addig a Stage Backgroud.................... 171 Step 3: Addig ad Removig Sprites................... 171 Step 4: Addig Variables Required by the Applicatio...... 172 Step 5: Addig a Audio File to the Applicatio........... 173 Step 6: Addig Scripts to Capture Player Iput............ 173 Step 7: Processig Player Guesses...................... 174 Step 8: Savig ad Executig Your New Scratch Applicatio.. 176 Summary.......................................... 176 Chapter 9 Coditioal ad Repetitive Logic... 177 Itroducig Scratch Cotrol Blocks....................... 177 Evet Programmig.................................. 178 Pausig Script Executio............................... 179 Executig Loops..................................... 180 Sedig ad Receivig Broadcasts........................ 183 Coditioal Programmig Logic......................... 184 Nestig Coditioal Cotrol Code Blocks................ 186 Prevetig Edless Loops............................ 186 Termiatig Script Executio........................... 187 Developig the Ball Chase Game......................... 188 Step 1: Creatig a New Scratch Project.................. 189 Step 2: Addig ad Removig Sprites................... 189 Step 3: Addig Variables Required by the Applicatio...... 191 Step 4: Addig a Audio File to the Applicatio........... 191 Step 5: Addig a Script to Cotrol Ball Movemet......... 191 Step 6: Addig Scripts That Display Game Over Messages.... 192 Step 7: Addig Scripts Needed to Cotrol ad Coordiate Game Play....................................... 192 Step 8: Savig ad Executig Your Scratch Project......... 195 Summary.......................................... 195 Chapter 10 Chagig the Way Sprites Look ad Behave... 197 Chagig Sprite Costumes ad Backgrouds................ 198 Chagig Sprite Costumes........................... 198 Chagig a Stage s Backgroud Costumes............... 200

Cotets xi Makig Sprites Talk ad Thik.......................... 201 Applyig Special Effects to Costumes ad Backgrouds........ 202 Chagig a Sprite s Size............................... 204 Makig Sprites Appear ad Disappear..................... 205 Determiig What Happes whe Two Sprites Overlap........ 206 Developig the Crazy Eight Ball Game.................... 207 Step 1: Creatig a New Scratch Project.................. 209 Step 2: Addig ad Removig Sprites................... 209 Step 3: Addig a Variable Required by the Applicatio...... 210 Step 4: Addig a Audio File to the Applicatio........... 210 Step 5: Creatig a Script to Cotrol the Display of the 8 i the Eight Ball....................................... 210 Step 6: Addig the Programmig Logic Needed to Cotrol the Eight Ball....................................... 211 Step 7: Savig ad Executig Your Scratch Project......... 212 Summary.......................................... 212 Chapter 11 Spicig Thigs Up with Souds... 213 Playig Souds...................................... 214 Play a Drum........................................ 216 Playig Musical Notes................................. 217 Cofigurig Audio Volume............................. 219 Settig ad Chagig Tempo........................... 220 Creatig the Family Picture Movie........................ 221 Step 1: Creatig a New Scratch Project.................. 222 Step 2: Addig ad Removig Sprites ad Backgrouds..... 223 Step 3: Addig a Variable Required by the Applicatio...... 225 Step 4: Addig a Audio File to the Applicatio........... 225 Step 5: Developig the Applicatio s Programmig Logic.... 226 Step 6: Savig ad Executig Your Scratch Project......... 230 Summary.......................................... 230 Chapter 12 Drawig Lies ad Shapes... 231 Clearig the Stage Area............................... 231 Drawig with the Pe................................ 232 Settig Pe Color.................................... 234 Chagig Pe Shade.................................. 236 Workig with Differet Size Pes........................ 238

xii Cotets Stampig a Istace of a Costume o the Stage............ 239 Creatig the Doodle Drawig Applicatio.................. 240 Step 1: Creatig a New Scratch Project.................. 241 Step 2: Addig ad Removig Sprites................... 242 Step 3: Creatig Scripts Used to Cotrol the Doodle Drawig Applicatio............................... 244 Step 4: Savig ad Executig Your Scratch Project......... 247 Summary.......................................... 247 PART III ADVANCED TOPICS.... 249 Chapter 13 Sharig Your Scratch Projects over the Iteret... 251 Ruig Scratch Applicatios o the Iteret............... 251 Registerig with the Scratch Website..................... 252 Uploadig Your Scratch Applicatios..................... 254 Viewig ad Orgaizig Your Applicatios Olie........... 257 Ruig Your Applicatio........................... 257 Addig Commets................................. 257 Addig Tags..................................... 259 Creatig Galleries................................. 260 Removig Projects................................. 264 Updatig Your Projects............................. 264 Other Scratch Website Features....................... 264 Dowloadig Other People s Projects..................... 265 Summary.......................................... 266 Chapter 14 Collectig Exteral Iput Usig a Scratch Board... 267 Iteractig with the Real World......................... 268 Buyig a Scratch Board................................ 269 Istallig Your Scratch Board........................... 269 Usig the Sesor Block to Iteract with Your Scratch Board..... 270 Collectig Iput Usig the Slider Cotrol................ 270 Usig the Butto Cotrol to Iitiate Actio.............. 272 Reactig to Light.................................. 272 Respodig to Soud.............................. 273 Measurig Electrical Resistace....................... 274 Keepig a Watchful Eye o Sesor Data................. 275 Summary.......................................... 276

Cotets xiii Chapter 15 Fidig ad Fixig Program Errors... 277 Dealig with Applicatio Errors......................... 277 Uderstadig Sytax Errors......................... 279 Keepig a Eye Out for Logical Errors.................. 279 Trackig Dow Ru-Time Errors....................... 280 Debuggig Your Scratch Applicatios..................... 281 Basic Debuggig Techiques......................... 281 Ruig Your Applicatio i Sigle Steppig Mode........ 284 Watch Out whe Removig Souds ad Sprites.............. 287 Gettig Help....................................... 288 Referrig to Scratch s Olie Help..................... 289 Gettig Help for Idividual Code Blocks................. 289 Gettig Help from Other Scratch Programmers............ 291 Summary.......................................... 292 PART IV APPENDICES... 293 Appedix A What s o the Compaio CD?... 295 Appedix B What Next?... 297 Glossary... 303 Idex..... 307

Itroductio Welcome to Scratch Programmig for Tees! Scratch is a programmig laguage developed by the MIT Media Lab for the purpose of teachig programmig to tees ad other first-time programmers. Scratch is a ew programmig laguage, iitially released i May 2007. Scratch supports the developmet of computer games, iteractive stories, graphic artwork ad computer aimatio, ad all sorts of other multimedia projects. Scratch allows ew programmers to create programs by sappig together blocks. Scratch cosists of a programmig laguage made up of differet blocks ad a easy to lear graphical developmet eviromet that icludes a pait applicatio for creatig graphics ad built-i soud editig capabilities. Scratch also comes with huge collectios of sample applicatios as well as graphics ad soud files, all of which you ca use to create your ow Scratch projects. As demostrated i Figure A.1, Scratch programs are made up of graphical blocks, which are sapped together. Scratch blocks resemble puzzle pieces i the way that they sap together. Scratch blocks ca oly be sapped together i ways that make sese, prevetig ew programmers from usig them i ivalid combiatios. I this way, Scratch eforces proper programmig sytax ad esures that ew programmers lear the proper way to assemble ad formulate programmig logic. Scratch s developmet was ispired by the method that hip-hop DJs use to mix ad scratch records to create ew ad uique music. I Scratch, ew programmers xiv

Itroductio xv Figure A.1 Script blocks are used as the basis for writig scripts that help brig applicatios to life. are able to create ew applicatio projects that icorporate pre-built code blocks, graphics, ad soud files i all kids of ew combiatios. Scratch lets programmers modify applicatios o the fly, allowig chages to be made eve while Scratch applicatios are ruig. The result is a iteractive, real-time programmig eviromet that ecourages experimetatio ad learig. This book s primary goal is to teach you everythig you eed to kow to lear the basics of computer programmig with Scratch. To help accomplish this goal, this book will emphasize learig by doig through the developmet of a series of fu ad iterestig exercises. Why Scratch? Scratch provides everythig eeded to begi developig computer games, multimedia presetatios, iteractive stories, graphic artwork, ad computer aimatio. Scratch ca be used to play digital music ad soud effects. Scratch s buildig block approach to programmig sets it apart from other programmig laguages. This makes Scratch easier to lear. Ad yet Scratch provides plety of programmig power, allowig you to build very powerful applicatio projects. If you aspire to oe day become a professioal programmer, you will fid that Scratch provides everythig eeded to build a foudatio from which you ca make the trasitio. Scratch also packs all of the programmig power ad puch eeded to satisfy the programmig eeds of most computer ethusiasts ad hobbyists. Who Should Read This Book? Scratch Programmig for Tees is desiged to provide all of the istructio that a first-time programmer requires to quickly get up ad ruig. Previous programmig experiece will certaily be helpful, but it is by o meas a

xvi Itroductio requiremet of this book. This book makes o assumptios about your computer backgroud other tha that you are comfortable workig with oe of the operatios systems supported by Scratch. This book provides everythig you eed to get started with Scratch. Before you kow it, you will be creatig all kids of projects, icorporatig graphics, soud, ad aimatio. As you lear how to program with Scratch, you will lear programmig priciples ad techiques that you ca later apply to other programmig laguages. As such, you will be able to apply what you lear about programmig with Scratch to other programmig laguages like Microsoft Visual Basic ad AppleScript. What You Need to Begi Obviously, the first thig you eed is a copy of Scratch. Scratch is available for free dowload at the Scratch website located at http://scratch.mit.edu/dowload. You ca also dowload a copy from the CD icluded i the back of the book. You also eed good istructio, which you will fid i this book. I additio to Scratch ad this book, you eed a computer ruig a supported operatig system, which also meets Scratch s miimum system requiremets. Supported Operatig Systems Scratch ca be ru o computers usig either Microsoft or Macitosh operatig systems. Specifically, Scratch ca be istalled o a computer ruig ay of the followig operatig systems. Microsoft Widows 98/ME Microsoft Widows NT/2000 Microsoft Widows XP/Vista Mac OS X Versio 10.3 or higher All of the figures ad examples i this book will be show usig Scratch 1.2.1 ruig o computers usig either Microsoft Vista or Mac OS X 10.5. If you are goig to be workig with Scratch o a differet versio of Widows or Mac OS X, you may otice small differeces i the way thigs look. However, all major Scratch features ad fuctioality should work the same ad you

Itroductio xvii should ot have ay problems followig alog with the istructio provided i this book. Note There is o official Liux versio of Scratch curretly available. However, members of the Scratch commuity have created differet Scratch implemetatios for Liux. A example of oe such implemetatio is available at http://tcpdpodcast.org/scratch.html. Miimum System Requiremets Scratch does ot impose ay additioal hardware requiremets over ad above those required by the operatig system. However, as Table A.1 shows, Scratch does impose scree resolutio ad disk space requiremets, which must be met for Scratch to ru. To work with Scratch, you must be able to display its graphical iterface, also referred to as its itegrated developmet eviromet or IDE. This iterface requires that the computer s scree resolutio be set to 1024 768 or higher. Aythig less ad part of the iterface will disappear off the scree. Scratch comes packed with all kids of graphics ad audio files that you ca use whe creatig ew Scratch projects. As a result, your computer must have at least a extra 120 MB of hard disk space i order to istall Scratch. Note Oe of the really eat thigs about Scratch is the ability to share Scratch applicatio projects with others o the Iteret at the Scratch website (Scratch.mit.edu). To participate i this experiece, your computer eeds to have Java istalled. Mac OS X comes with Java pre-istalled. However, by default, Microsoft Widows does ot. So, if you are a Widows user ad you have ot yet istalled Java o your computer, you ca do so by visitig http://java.com/e/dowload.idex.jsp. Table A.1 Scratch Miimum System Requiremets Requiremet Scree Resolutio Hard Disk Recommeded 1024 768 (16-bit color) 120 MB

xviii Itroductio Of course, Scratch s miimum hardware requiremets are just that, miimum requiremets. If your computer s memory ad processor exceed the miimum requiremets of the operatig system, thigs will ru a lot faster ad you will be a lot happier. I additio, you will eed extra hard drive space beyod the 120 MB miimum required to istall Scratch to have a place to store your creatios. Scratch lets you create projects that icorporate the use of soud, both as iput ad output. To take advatage of this feature, your computer will eed both speakers ad a microphoe. How This Book Is Orgaized Scratch Programmig for Tees is orgaized ito four parts. This book was writte with the expectatio that you will read it sequetially, from cover to cover. However, if you have some previous programmig experiece, you may istead wat to jump aroud a bit, focusig o topics that iterest you the most. Part I of this book is made up of four chapters that provide a itroductio to Scratch ad its developmet eviromet. You will also lear about the differet compoets that make up Scratch projects ad the lear how to create ad execute Scratch projects. Part II cosists of eight chapters, each of which is desiged to provide istructio o how to work with differet types of Scratch blocks. You will lear how to use blocks that move thigs aroud, store ad retrieve data, as well as perform math ad coditioal ad repetitive logic. You will also lear how to itegrate soud ad draw lies ad shapes. Part III of this book is made up of three chapters, each of which focuses o a differet advaced topic. These topics iclude learig how to share your Scratch projects with others o the Iteret, how to create Scratch projects that use the Scratch Board, ad how to fid ad fix program errors that prevet your Scratch projects from workig like you wat them to. Part IV is made up of two appedices ad a glossary. The first appedix reviews the list of sample Scratch projects that you will lear how to develop as you make your way through this book. The secod appedix provides a list of websites ad readig materials that you will wat to explore to cotiue learig more about Scratch ad to further your programmig kowledge.

Itroductio xix Covetios Used i This Book Oe of the primary objectives of this book is for it to be easy to read ad uderstad. To help support this objective, a umber of simple covetios have bee used throughout the book to highlight critical iformatio ad help emphasize specific poits. These covetios are briefly described below. Italics. Key terms that you will wat to uderstad ad remember are highlighted usig italics the first time that they are istructed. So remember, aytime you see a term i italics, take a extra momet to thik about it ad uderstad its meaig or purpose. Note Notes are used to provide additioal iformatio about a topic, feature, or idea to better help you uderstad its impact or implicatios. Tip Tips are used to poit out programmig shortcuts that will help make you a better ad more efficiet programmer. Cautio Cautios are used to idetify areas where you are likely to ru ito problems ad the provide advice o how to deal with the problem or prevet problems from occurrig, makig you a better, more efficiet, ad much happier programmer.

This page itetioally left blak

Part I Scratch Basics

This page itetioally left blak

chapter 1 Itroducig Scratch Scratch is a programmig laguage developed to help youg people betwee the ages of 8 ad 16 lear 21st cetury skills by developig computer programs. The developmet of Scratch was ispired by the scratchig process that DJs use to create ew souds ad music by rubbig old-style viyl records back ad forth o record turtables, creatig a ew ad distictively differet soud out of somethig that already exists. I similar fashio, Scratch applicatio projects mix together graphics ad souds i order to use them i ew ad differet ways. To help get you started with Scratch programmig, this chapter provides a overview of the laguage ad reviews the steps that you eed to follow to get up ad ruig quickly. The major topics covered i this chapter iclude: A review of Scratch s capabilities ad uses Istructio o how to istall Scratch o both Microsoft Widows ad Mac OS X A discussio of the beefits of joiig Scratch s global commuity A demostratio of how to create ad execute your first Scratch applicatio project 3

4 Chapter 1 Itroducig Scratch Gettig to Kow Scratch With traditioal computer ad Iteret applicatios, users are limited to workig with applicatios i the way the programmers who developed the applicatios desiged. Scratch turs thigs aroud by lettig users become programmers. Scratch is desiged to meet the eeds of youg people betwee 8 ad 16, helpig to itroduce them to computer techology ad to improve their learig skills while at the same time facilitatig creativity ad persoal expressio. May people regard computer programmig as a mysterious ad complex process that requires advaced techical traiig ad educatio. This is a misperceptio. Programmig laguages like BASIC have bee aroud for decades ad were developed expressly for the purpose of teachig first-time programmers how to program. I recet years, a ew crop of programmig laguages has appeared, specifically geared towards helpig childre ad studets lear to program. Oe of the very best ad ewest of these laguages is Scratch. Scratch is a visual programmig laguage that is made up of a graphic iterface that supports applicatio developmet i which ew projects are created by mixig together images, soud, ad video uder the cotrol of scripts, which specify the applicatio s programmig logic. Scripts are created by sappig blocks together, much i the same way that Lego blocks are sapped together to create all sorts of uique creatios. Each block represets a differet commad or actio that tells the applicatio how to execute. Scratch also provides programmers with access to all kids of media, icludig graphics ad souds as well as tools that ca be used to create ew graphics ad soud files. Note Scratch is also beig istalled o all XO laptops, as part of the Oe Laptop Per Child Project, which is a program desiged to produce ad distribute iexpesive laptop computers to childre i developig coutries aroud the world to help their educatio ad ulock their potetial. Scratch is a iterpreted programmig laguage. This meas that applicatio projects are ot precompiled (tured ito executable code that ca be ru as a stad-aloe applicatio) before their executio. Istead, the code blocks that make up Scratch applicatio projects are iterpreted ad processed each time the applicatio project is executed. Scratch is also a dyamic programmig laguage.

Gettig to Kow Scratch 5 It allows chages to be made to applicatio projects eve while the projects are executig. As such, Scratch lets programmers experimet by makig applicatio chages o the fly i order to see what type of effect the chages may have o the applicatio s executio. Imagie Program Share! Scratch s sloga is Imagie Program Share! It is desiged to ecourage tees creativity by providig them with a easy to lear yet powerful programmig eviromet i which they ca uleash the power of their imagiatio. Scratch ecourages ad facilitates the developmet of applicatio projects usig a mixture of media, graphics, soud, ad video i order to create somethig ew. Scratch provides ew programmers with everythig eeded to create ad execute ew applicatio projects. Its programmig laguage is desiged to make it as easy as possible for ew programmers to jump i ad get their feet wet ad to receive immediate feedback o their progress. Scratch promotes a uderstadig of programmig cocepts, icludig coditioal ad iterative logic, evet programmig, the use of variables, mathematics, ad the use of graphics, ad soud effects. By learig to program with Scratch, ew programmers develop a uderstadig ad appreciatio of the desig process, from idea geeratio to program developmet, the testig ad debuggig ad the icorporatio of user feedback. People, especially kids, love to share, as demostrated through the amazig success of websites like YouTube, which allows people to share home video. Sharig is a fudametal part of the Scratch programmig experiece. Scratch applicatio projects ca ot oly be ru o the programmer s desktop but ca also be uploaded to the Scratch website, where they ca be viewed, executed olie, ad commeted o by other Scratch programmers from aroud the world. By postig their Scratch applicatio projects o the Scratch website, kids share their experieces ad lear from oe aother ad gai gratificatio ad cofidece from the experiece. Hit To share a applicatio project, Scratch programmers must provide the source code that makes the applicatio work. There is o way to keep the source code hidde.

6 Chapter 1 Itroducig Scratch Scratch Ucovered For your coveiece, a free trial copy of Scratch (versio 1.2.1) is available o this book s compaio CD-ROM. I additio, Scratch ca be dowloaded from the Scratch website located at http://scratch.mit.edu/dowload. Ulike may programmig laguages such as Microsoft Visual Basic or C++, Scratch is a ope source project. What this meas is that all of the source code that makes up the Scratch programmig laguage is freely available. I fact, if you wat, you ca dowload a copy of the source code for Scratch at http://scratch.mit.edu/pages/ source. Note Scratch was developed usig aother programmig laguage kow as Squeak. Squeak is a crossplatform programmig laguage, meaig that it ca be used to develop applicatios o may differet computer operatig systems. By selectig Squeak as the programmig laguage used to create Scratch, Scratch s developmet team esured that they would be able to create ad execute Scratch o differet operatig systems, icludig Microsoft Widows ad Mac OS X. If you are curious, you ca lear more about Squeak by visitig http://www.squeak.org. Examples of other ope source programmig laguages iclude Ruby ad Perl. However, ulike these programmig laguages developed by a commuity of programmers workig together collectively, Scratch was developed as a closed developmet project. This meas that all Scratch developmet is performed by the Lifelog Kidergarte Group at MIT Media Lab. Scratch s Buildig Block Approach to Programmig Scratch is a ew programmig laguage, iitially released i March 2006. Scratch is differet from other programmig laguages like Visual Basic i that it does ot support a text-based approach to programmig, as demostrated here: //Excerpt from a Visual Basic applicatio If strcurretactio = "FillCircle" The Dim objcoordiates As Rectagle objcoordiates = _ New Rectagle(Math.Mi(objEd.X, objstart.x), _ Math.Mi(objEd.Y, objstart.y), _ Math.Abs(objEd.X - objstart.x), _ Math.Abs(objEd.Y - objstart.y)) Pick_Color_Ad_Draw("FillCircle", objcoordiates) Ed If

Gettig to Kow Scratch 7 Figure 1.1 A example of how programmig logic is outlied i a Scratch applicatio project. I text-based programmig laguages, code statemets are formulated by followig a complex set of sytax rules. Failure to precisely follow these rules whe writig statemets leads to sytax errors that prevet applicatios from ruig. Scratch, o the other had, uses a differet approach. Scratch applicatio projects are built by selectig ad sappig together graphical programmig blocks, as demostrated i Figure 1.1. By usig code blocks i place of complex program text statemets, Scratch sigificatly simplifies applicatio developmet while still makig use of the same basic programmig logic ad cocepts implemeted i other programmig laguages. As Figure 1.1 demostrates, each code block represets a differet commad or actio. Blocks fit together like pieces i a puzzle. You ca oly sap together blocks i ways that make sytactic sese, completely elimiatig sytax errors that proliferate i other programmig laguages. Some code blocks are cofigurable, allowig you to specify thigs like the umber of times a actio should execute, text that is to be displayed, or the color to be used whe displayig somethig o the scree. Despite its use of graphical code blocks, Scratch supports the same basic set of programmig techiques ad costructs as do other traditioal programmig laguages. For example, Scratch supports variables, coditioal ad iterative logic, ad evetdrive programmig. Scratch also supports the maipulatio of graphics ad the itegratio of soud ito applicatio projects.

8 Chapter 1 Itroducig Scratch Note Scratch is desiged for teachig first-time programmers how to program. To make the learig experiece as straightforward ad uderstadable as possible, the developers of Scratch have sometimes sacrificed programmig power ad features i favor of simplicity ad ease of learig. The goal of the Scratch developmet team is to promote learig ad ot to develop a programmig laguage capable of deliverig every advaced programmig feature required by professioal programmers. As a result, Scratch lacks some programmig features curretly supported i advaced programmig laguages. Istead, Scratch focuses o fudametal programmig cocepts to provide ew programmers with a foudatio upo which they ca later build, whe ad if they decide to move o to other programmig laguages. Istallig Scratch Before you ca use Scratch, you eed to istall it o your computer. The istallatio process varies, depedig o whether you use Microsoft Widows or Mac OS X. Istructios for istallig Scratch o both of these operatig systems are provided i the sectios that follow. You will fid the istallatio files eeded to istall Scratch 1.2.1 o this book s compaio CD-ROM. Alteratively, you ca dowload a copy of Scratch from the Scratch website by executig the followig steps: 1. Go to http://scratch.mit.edu ad click o the Dowload Scratch Now! lik. 2. The Dowload Scratch page appears. Fill i the optioal form to receive updates about Scratch. 3. Click o the Cotiue to Scratch Dowload butto. The web page show i Figure 1.2 displays. Click o the appropriate lik for your operatig system. The Widows dowload file is provided as a self-extractig executable amed ScratchIstaller.exe. The Mac OS X istallatio file is provided as a Mac OS X disk image file amed MacScratch.dmg. Both of these istallatio files are approximately 30MB i size, so to dowload them you will wat to use a broadbad Iteret coectio. Note There is o official Liux versio of Scratch curretly available. However, a user-adapted versio of Scratch, alog with istructios for istallig it, is available at http://tcpdpodcast.org/ scratch.html.

Istallig Scratch 9 Figure 1.2 Dowloadig either the Mac OS X or Widows versio of Scratch. Istallig Java o Widows While Mac OS X comes with Java already istalled, Widows does ot. Fortuately, istallig Java o Microsoft Widows is both free ad easy. To do so, go to http://java.com/e/dowload as show i Figure 1.3 ad click o the Free Java Dowload butto. Oce the olie istallatio process begis, you will eed to complete the followig steps to fiish istallig Java: 1. After clickig o the Free Java Dowload butto, you may be prompted by a Widows security widow for permissio to allow the istallatio process to cotiue. If so, click o the Cotiue butto.

10 Chapter 1 Itroducig Scratch Figure 1.3 Java is required to view ad execute Scratch projects loaded oto the Scratch website. 2. Next, a widow will appear requestig permissio to begi the istallatio process. Click o the Istall butto to cotiue. 3. Fially, a Java Setup Wizard will appear, requirig that you accept the Java Licese Agreemet. Click o the Accept butto ad the follow the rest of the wizard s istructio to complete the istallatio process. Istallig Scratch o Widows Scratch istalls o Microsoft Widows like ay other Widows applicatio. The followig procedure outlies the steps ivolved i completig Scratch s istall process:

Istallig Scratch 11 Figure 1.4 Istallig Scratch o Microsoft Widows. 1. Double-click o the ScratchIstaller.exe file. 2. If prompted for cofirmatio, click o Ru to allow the istallatio process to begi. 3. If a security message displays, click o Allow to give permissio for the istallatio process to cotiue. 4. The Scratch Setup Wizard will the appear, as demostrated i Figure 1.4. Click o Next ad follow the istructios provided by the wizard to complete the istallatio process. 5. Oce the Scratch Setup Wizard has completed the istallatio process, you will eed to click o the Fiish butto to close the wizard. Scratch will the automatically start, as demostrated i Figure 1.5. I additio, a shortcut for Scratch will be added to the Widows desktop. Note I additio to beig able to start Scratch by clickig o its desktop shortcut ico, you ca click o Start > All Programs > the Scratch folder > ad the the Scratch ico.

12 Chapter 1 Itroducig Scratch Figure 1.5 Ruig Scratch o Microsoft Widows Vista. Istallig Scratch o Mac OS X To istall Scratch o Mac OS X, double-click o the MacScratch.dmg archive file to ope it. Iside you will see a folder amed Scratch. Drag ad drop the Scratch folder to your Applicatios folder (or to ay other locatio that you wat) to istall it. The cotets of the Scratch folder are show i Figure 1.6. To start Scratch ad begi workig with it, double-click o the Scratch ico, which is represeted as a cartoo image of a cat. Withi a few momets, the Scratch IDE should appear, as show i Figure 1.7.

Istallig Scratch 13 Figure 1.6 Istallig Scratch o Mac OS X. Figure 1.7 Ruig Scratch o Mac OS X 10.5.

14 Chapter 1 Itroducig Scratch Note The first time you start Scratch, Mac OS X may display a popup dialog widow promptig you for cofirmatio that you wat to ru Scratch, because it is a applicatio dowloaded from the Iteret. Click o the Ope butto to allow Scratch to start. This popup dialog widow will ot display upo subsequet startups. Creatig Your First Scratch Applicatio Scratch applicatio projects are made up of objects called sprites. A sprite is a two-dimesioal bitmap image draw o a trasparet backgroud. Sprites ca be moved aroud ad made to iteract with oe aother. Sprites cosist of three primary compoets, as outlied here: Scripts. Collectios of code blocks that outlie the programmig logic that cotrols the operatio of sprites. Costumes. Images that are used to display the sprite o a area of the Scratch IDE, referred to as the stage. Sprites ca cosist of ay umber of costumes. Souds. Soud effects that are played durig applicatio executio whe certai evets occur or as backgroud audio. A sprite s appearace ca be chaged by assigig it differet costumes. To move a sprite ad cotrol its behavior, you sap together code blocks to create scripts. Sprites ca have ay umber of scripts associated with them. Scripts ca be ru by double-clickig the code blocks that make them up, i which case each block i the script is executed i top-dow order. You ca also set thigs up so that scripts automatically ru whe various evets occur. For example, you ca cofigure script executio to occur whe a sprite is clicked or whe it iteracts with other sprites. Sprites are displayed ad iteract with oe aother o a stage. As such, sprites are ofte referred to as actors. Scratch s stage is located i the upper-right corer of its graphical iterface. Note Sprites ca be selected from a predefied collectio of graphic objects supplied with Scratch. They ca also be copied ad pasted from your hard drive or the Iteret or created usig Scratch s builti Pait Editor.

Creatig Your First Scratch Applicatio 15 Creatig a New Scratch Project Now that you are familiar with the basic compoets of sprites, let s sped a few miutes learig how to create your first Scratch applicatio project. All ew Scratch projects automatically cotai a sigle sprite, represetig a image of a kitte. By default, the sprite, amed Sprite1, does ot have ay scripts but does have two costumes ad two souds associated with it. Usig this sprite, let s create a Scratch applicatio project that makes the kitte meow ad say Hello World! whe clicked. The first step i creatig a ew Scratch applicatio is to click o the New butto located at the top of the Scratch IDE. I respose, Scratch will create a ew project, as show i Figure 1.8. As Figure 1.8 shows, the Scratch IDE is orgaized ito a umber of separate compoets. For starters, the code block area cotais code blocks, orgaized ito eight differet collectios. You will use selected code blocks to create a script that makes the kitte talk. Code Block Area Sprite Area Stage Sprite List Figure 1.8 Creatig a ew Scratch applicatio project.

16 Chapter 1 Itroducig Scratch To the right of the code block area is the sprite area. Iformatio about the curretly selected sprite is displayed at the top of this area. Just beeath this iformatio are three tabs, which are used to cotrol access to the scripts, costumes, ad souds belogig to the sprite. To the right of the sprite area is the stage, which curretly displays the default costume belogig to Sprite1. Just beeath the stage is the sprite list, which displays a list of all the sprites that make up the applicatio project. Note Chapter 2, Gettig Comfortable with the Scratch Developmet Eviromet, provides a detailed overview of all of the compoets that make up the Scratch IDE. Chagig Sprite Attributes The applicatio project that you are creatig is desiged to work with the default sprite. Rather tha use the sprite s default ame of Sprite1, let s assig it a more descriptive ame. To do so, overtype the text displayed at the top of the sprite area with the word Cat. Oce you chage the ame assiged to the sprite, the ame chage will automatically be reflected i the sprite list. If you look at the etry for the sprite i the sprite list, you should see a picture of the sprite, its ew ame, ad the umber of costumes curretly assiged to the sprite (you ca click o the Costumes tab at the top of the sprite area to view the sprite s costumes). Addig Code Blocks Now that you have chaged the ame of the sprite, it is time to add the code blocks required to make the cat meow ad say Hello World! Let s begi by clickig o the Soud butto located at the top of the code block area. This displays a collectio of code blocks that cotrol the playback of soud effects. Locate the code block labeled play soud ad drag ad drop it oto the sprite area, as show i Figure 1.9. By default, this code block is automatically set up to play a audio file that makes a meow soud. Next, click o the Looks butto located at the top of the code block area. This displays a collectio of code blocks that cotrol the appearace of a sprite. Locate the code block labeled say Hello! for 2 secs ad drag ad drop it oto the sprite area, as show i Figure 1.10. By default, this code block displays a text strig iside a graphical bubble captio. This code block has two editable fields: a text field ad a umeric field. Sice the

Creatig Your First Scratch Applicatio 17 Figure 1.9 Usig a soud block to make the kitte meow. kitte is supposed to display the message Hello world! whe clicked, replace the text Hello! with Hello World!. As previously stated, you ca ru a script at ay time by double-clickig o it. To test this, double-click o oe of the two code blocks that you have added ad the watch the kitte o the stage, ad you ll hear it meow ad display its message. Rather tha havig to double-click o the script to make the kitte do its thig, let s set thigs up so that the kitte automatically meows ad talks wheever you click o it. This is accomplished by clickig o the Cotrol butto located at the top of the code block area ad the draggig ad droppig the cotrol block labeled whe Cat clicked o top of the two buttos you have already added to the sprite s script, as demostrated i Figure 1.11. The whe Cat clicked block automatically saps i place as you move it toward the top of the script. With this block ow i place, click o the script file ad see

18 Chapter 1 Itroducig Scratch Figure 1.10 Usig a looks block to make the kitte say somethig. what happes. As demostrated i Figure 1.12, the kitte respods by meowig ad talkig (displayig "Hello world!" i a text captio bubble). Savig Your Work Okay, ow that you have your ew Scratch applicatio project workig, it is time to save your work. This is doe by clickig o the Save butto located at the top of the Scratch IDE. I respose, the Save Project widow show i Figure 1.13 displays, allowig you to assig a ame to your project ad store it o your computer. Type Hello World i the New Fileame field to ame your applicatio. If you wat, you ca type your ame i the Project Author field ad the eter a short descriptio i the About This Project field ad the click o the OK butto to save your project.