Cover image for Scratch 2.0 programming for teens
Title:
Scratch 2.0 programming for teens
Personal Author:
Edition:
2nd ed.
Publication Information:
Boston, MA : Cengage Learning PTR, 2014
Physical Description:
xvi, 367 pages : illustrations ; 23 cm.
ISBN:
9781305075191
General Note:
Includes index

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010329043 QA76.165 F67 2014 Open Access Book Book
Searching...

On Order

Summary

Summary

With Scratch 2.0, getting started in computer programming is easier and more fun than ever. And with this completely updated edition of the popular Scratch Programming for Teens, you'll learn the basics in a fast, friendly way and be sharing your creations online before you know it. Focused on the fundamentals and using the free Scratch programming language, Scratch 2.0 Programming for Teens will teach you to develop interactive stories, games, animations, and other programs on the web, in your computer's browser, using graphic, customizable code blocks. Written especially for first-time programmers, this book's hands-on approach emphasizes the design and development of programming logic. You'll learn important programming concepts without getting bogged down in complicated details. And the basic principles you learn here will build a foundation from which you can move on to other, more complex, programming languages (like Microsoft Visual Basic, Java, and C++), if you decide to go deeper into software development. Additional material, including helpful appendixes and a complete glossary, is available on this book's companion website. Start programming today with Scratch 2.0 Programming for Teens. Scratch is a project of the Lifelong Kindergarten group at the MIT Media Lab. Scratch, the Scratch logo, and the Scratch Cat are trademarks of the Massachusetts Institute of Technology.


Author Notes

Jerry Lee Ford, Jr. is an author, educator, and IT professional with more than 24 years of experience in information technology, including roles as an automation analyst, technical manager, technical support analyst, automation engineer, and security analyst. He is the author of 37 books and coauthor of two more. Ford has a master's degree in business administration from Virginia Commonwealth University in Richmond, Virginia, and has worked as an adjunct instructor teaching networking courses in information technology.


Table of Contents

Introductionp. xi
Chapter 1 Introducing Scratch 2.0p. 1
Getting to Know Scratch 2.0p. 1
Imagine-Program-Share!p. 2
Scratch Uncoveredp. 3
Scratch 2.0's Building Block Approach to Programmingp. 4
Getting Ready for Scratch 2.0p. 6
Creating Your First Scratch 2.0 Applicationp. 8
Creating a New Scratch 2.0 Projectp. 9
Changing Sprite Attributesp. 11
Adding Code Blocksp. 12
Saving Your Workp. 16
Joining Scratch 2.0's Global Communityp. 17
Sharing Your Application Projectsp. 17
Registering with the Scratch 2.0 Websitep. 19
Changing Your Scratcher Statusp. 21
Keeping in Touchp. 22
Chapter 2 Getting Comfortable with the Scratch 2.0 Development Environmentp. 25
Getting Comfortable with the Scratch 2.0 Project Editorp. 26
Getting Familiar with Menu Bar Commandsp. 27
Running Scratch 2.0 Applications on the Stagep. 28
Running Applications in Full-Screen Modep. 30
Controlling Application Executionp. 31
Working with the Sprite Listp. 31
Generating New Spritesp. 34
Tracking Mouse Pointer Locationp. 36
Switching Between Code Block Groupsp. 36
Getting Comfortable with the Scripts Areap. 37
Backpackp. 44
Adding Project Instructions, Notes, and Creditsp. 45
Creating New Sprites Using Scratch's Paint Editorp. 47
Examining the Drawing Canvasp. 49
Working with Editor Toolsp. 50
Working with Button Controlsp. 53
Specifying Color Settingsp. 54
Configuring a Sprite's Rotation Centerp. 54
Chapter 3 A Review of the Basic Components of Scratch Projectsp. 57
Working with Blocks and Stacksp. 57
Argumentsp. 59
Default Valuesp. 60
Six Basic Types of Scratch Blocksp. 61
Working with Stack Blocksp. 61
Working with Hat Blocksp. 62
Working with Reporter Blocksp. 63
Working with Boolean Blocksp. 64
C Blocksp. 65
Cap Blocksp. 65
Keeping an Eye Out with Monitorsp. 66
Ten Categories of Scratch Blocksp. 68
Moving Objects Around the Drawing Canvasp. 69
Changing Object Appearancep. 70
Making Some Noisep. 72
Drawing Lines and Shapesp. 74
Storing and Retrieving Datap. 75
Event-Driven Programmingp. 77
Implementing Looping and Conditional Logicp. 78
Sensing Sprite Location and Environmental Inputp. 79
Working with Operatorsp. 81
Custom and Specialized Blocksp. 83
Getting Help with Code Blocksp. 85
Chapter 4 Mr. Wiggly's Dance-A Quick Scratch Projectp. 87
Programming with Scratchp. 87
Creating the Mr. Wiggly's Dance Applicationp. 89
Step 1 Creating a New Scratch Projectp. 91
Step 2 Adding a Backdrop to the Stagep. 92
Step 3 Adding and Removing Spritesp. 96
Step 4 Adding Mr. Wiggly's Musicp. 99
Step 5 Playing the Dance Musicp. 102
Step 6 Making Mr. Wiggly Dancep. 105
Step 7 Testing the Execution of Your New Projectp. 108
Chapter 5 Moving Things Aroundp. 109
Working with Motion Code Blocksp. 109
Moving and Rotating Spritesp. 110
Setting Sprite Directionp. 113
Repositioning a Spritep. 115
Changing Sprite Coordinatesp. 117
Bouncing Sprites Around the Stage and Controlling Rotation Stylep. 118
Keeping Track of Sprite Coordinates and Directionp. 120
Taking Advantage of Scratch Cardsp. 121
Creating the Virtual Scratch Fish Tankp. 124
Step 1 Creating a New Scratch Projectp. 125
Step 2 Adding a Backdrop to the Stagep. 125
Step 3 Adding and Removing Spritesp. 125
Step 4 Adding a Suitable Audio File to the Stagep. 126
Step 5 Playing the Audio Filep. 127
Step 6 Animating the Swimming of the Fishp. 127
Step 7 Executing Your New Scratch Applicationp. 130
Chapter 6 Sensing Sprite Position and Controlling Environmental Settingsp. 131
Working with Sensing Code Blocksp. 132
Detecting Sprite Collisions and Distance from Objectsp. 133
Prompting For and Collecting User Inputp. 138
Retrieving Keyboard Input, Mouse Button, and Coordinate Statusp. 139
Retrieving Audio Datap. 143
Collecting and Processing Video Inputp. 144
Working with a Timerp. 147
Retrieving Stage and Sprite Datap. 148
Retrieving the Date, Time Data, and User's Namep. 149
Creating the Family Scrapbook Applicationp. 150
Step 1 Creating a New Scratch 2.0 Projectp. 152
Step 2 Adding and Removing Sprites and Costumesp. 152
Step 3 Adding a Suitable Audio File to the Stagep. 154
Step 4 Playing the Audio Filep. 154
Step 5 Adding the Programming Logic Required to Manage the Display of Photographsp. 155
Step 6 Saving and Executing Your New Scratch 2.0 Applicationp. 156
Chapter 7 Storing and Retrieving Datap. 159
Learning How to Work with Application Datap. 159
Storing Data in Variablesp. 161
Creating Scratch 2.0 Variablesp. 161
Assigning Variables to Sprites and the Stagep. 163
Assigning Names to Your Variablesp. 163
Understanding Variable Scopep. 163
Deleting Variables When They Are No Longer Neededp. 166
Accessing Variables Belonging to Other Spritesp. 167
A Quick Examplep. 168
Storing Collections of Data in Listsp. 170
Developing the Basketball Quiz Projectp. 175
Step 1 Creating a New Scratch 2.0 Projectp. 177
Step 2 Selecting an Appropriate Stage Backdropp. 177
Step 3 Adding and Removing Spritesp. 177
Step 4 Adding Variables That the Application Requiresp. 179
Step 5 Adding Scripts to Button Sprites to Collect User Inputp. 180
Step 6 Automating the Administration of the Quizp. 182
Step 7 Testing Your New Applicationp. 185
Chapter 8 Doing a Little Mathp. 187
Addition, Subtraction, Multiplication, and Divisionp. 187
Understanding the Mathematical Order of Precedencep. 189
Generating a Random Numberp. 190
Comparison Operationsp. 191
Performing Logical Comparisonsp. 195
Manipulating Stringsp. 197
Rounding Numbers and Retrieving Remaindersp. 199
Working with Built-In Mathematical Functionsp. 200
Developing the Number Guessing Game Quiz Projectp. 201
Step 1 Creating a New Scratch 2.0 Projectp. 203
Step 2 Adding a Stage Backdropp. 204
Step 3 Adding and Removing Spritesp. 204
Step 4 Adding Variables That the Application Requiresp. 205
Step 5 Adding an Audio File to the Applicationp. 206
Step 6 Adding Scripts to Capture Player Inputp. 206
Step 7 Processing Player Guessesp. 207
Step 8 Saving and Executing Your New Scratch 2.0 Applicationp. 209
Chapter 9 Controlling Script Executionp. 211
Introducing Scratch Events and Control Blocksp. 211
Event Programmingp. 212
Initiating Script Executionp. 212
Sending and Receiving Broadcastsp. 214
Controlling Script Executionp. 216
Pausing Script Executionp. 216
Executing Loopsp. 218
Conditional Programming Logicp. 220
Nesting Conditional Control Code Blocksp. 223
Preventing Endless Loopsp. 223
Terminating Script Executionp. 224
Cloning Spritesp. 226
Developing the Ball Chase Gamep. 228
Step 1 Creating a New Scratch Projectp. 230
Step 2 Adding and Removing Spritesp. 231
Step 3 Adding Variables That the Application Needsp. 232
Step 4 Adding an Audio File to the Applicationp. 233
Step 5 Adding a Script to Control Ball Movementp. 233
Step 6 Adding Scripts That Display Game Over Messagesp. 233
Step 7 Adding Scripts Needed to Control and Coordinate Game Playp. 234
Step 8 Saving and Executing Your Scratch Projectp. 237
Chapter 10 Changing the Way Sprites Look and Behavep. 239
Looks Blocks That Affect Sprites Versus the Stagep. 240
Making Sprites Talk and Thinkp. 241
Making Sprites Appear and Disappearp. 242
Changing Sprite Costumes and Stage Backdropsp. 243
Changing Sprite Costumesp. 243
Changing a Stage's Backdropp. 246
Applying Special Effects to Costumes and Backdropsp. 247
Changing a Sprite's Sizep. 249
Determining What Happens When Two Sprites Overlapp. 250
Retrieving Costume and Backdrop Datap. 252
Developing the Crazy Eight Ball Gamep. 252
Step 1 Creating a New Scratch 2.0 Projectp. 254
Step 2 Adding and Removing Sprites-p. 255
Step 3 Adding a Variable Required by the Applicationp. 256
Step 4 Adding an Audio File to the Applicationp. 257
Step 5 Creating a Script to Control the Display of the 8 in the Eight Ballp. 257
Step 6 Adding the Programming Logic Needed to Control the Eight Ballp. 257
Step 7 Saving and Executing Your Scratch 2.0 Projectp. 259
Chapter 11 Spicing Things Up with Soundsp. 261
Playing Soundsp. 261
Play a Drump. 263
Playing Musical Notesp. 265
Configuring Audio Volumep. 268
Setting and Changing Tempop. 269
Creating the Family Picture Moviep. 271
Step 1 Creating a New Scratch 2.0 Projectp. 273
Step 2 Adding and Removing Sprites and Backdropsp. 273
Step 3 Adding a Variable That the Application Requiresp. 276
Step 4 Adding a Sound to the Applicationp. 277
Step 5 Developing the Application's Programming Logicp. 277
Step 6 Naming and Testing Your Scratch 2.0 Projectp. 282
Chapter 12 Drawing Lines and Shapesp. 283
Clearing the Stage Areap. 283
Stamping an Instance of a Costume on the Stagep. 284
Drawing with the Penp. 286
Setting Pen Colorp. 287
Changing Pen Shadep. 291
Working with Different Size Pensp. 293
Creating the Doodle Drawing Applicationp. 296
Step 1 Creating a New Scratch 2.0 Projectp. 297
Step 2 Adding and Removing Spritesp. 298
Step 3 Creating Scripts to Control the Doodle Drawing Applicationp. 299
Step 4 Naming and Testing Your Scratch 2.0 Projectp. 304
Chapter 13 Improving Code Organizationp. 305
Simplifying Script Organization Through Proceduresp. 305
Creating Custom Blocksp. 306
Using a Define Block to Create a Procedurep. 310
Adding Clarity Through Commentsp. 311
Simplifying the Project and Reducing the Project Size with Cloningp. 313
Creating the Gone Fishing Applicationp. 316
Step 1 Creating a New Scratch 2.0 Projectp. 318
Step 2 Adding an Appropriate Backdropp. 318
Step 3 Adding Your Application's Spritesp. 318
Step 4 Defining an Application Variablep. 320
Step 5 Creating Scripts Used to Control the Applicationp. 321
Step 6 Testing Your Scratch 2.0 Projectp. 325
Chapter 14 Game Development Using Collision Detectionp. 327
Key Features Found in Most Computer Gamesp. 327
Managing Game Statep. 328
Controlling Game Play with Loopsp. 330
Managing Screen Refresh Ratesp. 331
Moving Things Around the Stagep. 331
Making Sprites Visible and Invisiblep. 332
Making Some Noisep. 334
Detecting Collisionsp. 335
Collecting Player Inputp. 341
Capturing Keyboard Inputp. 341
Capturing Mouse Inputp. 342
Tracking Mouse Movement and Locationp. 343
Detecting Mouse Button Clicksp. 343
Creating Scratch Pongp. 344
Step 1 Creating a New Scratch 2.0 Projectp. 346
Step 2 Setting Up the Backdrop and Adding and Removing Spritesp. 346
Step 3 Adding Sound Effectsp. 347
Step 4 Defining Variablesp. 347
Step 5 Creating Scripts Used to Control the Scratch Pong Gamep. 348
Step 6 Testing Your Scratch 2.0 Projectp. 353
Indexp. 355