Table of contents acknowledgements introducing scratch 3 vii viii 1 GAME ON Cat on the Move Cat and Mouse Fish in the Sea Bat in a Flap Kiran and the Magic Crystals Challenges 4 6 8 10 12 14 2 DRAWING BACKGROUNDS AND SPRITES 18 Down the River 20 Monster Maze 22 Penguin Bobsled Cross 24 Color Bounce 28 Racetrack 32 Challenges 3 WHAT’S THE SCORE Penguin Ski School Shark Diver Fruit Catcher Brick Tricks Colored Walls Challenges 4 MATH MATTERS Super Snake Cactus Jumper Tower Builder Robot Power Up Invasion of the Donuts Challenges 5 MAKING YOUR OWN BLOCKS Cave of Stars Space Tacos Two-Player Soccer Rocket Racers Catch the Snowflakes Challenges 36 40 44 48 52 56 60 64 68 72 76 82 86 90 94 100 106 112
Ackowledgements A big thanks to all my family for their support Rachel Linus Elsa and everyone else Thanks to all at MIT Scratch for creating such a fantastic website Thanks to everyone especially the pupils at New End Primary School for inspiring me Thanks to everyone at No Starch Press for their encouragement support and patience Thanks to previous colleagues and friends who have supported and championed my ideas including Daniel Anthony Nigel Lewis Rob Ben Rich Samson Karyn Dan Donna Lorraine Jyoti Charlie Gillian Maxime and Natalie Thanks to Anne for the advice and Bob for listening
introducing scratch 3 In this book you’ll learn how to code your own games with Scratch 3 You’ll use different blocks to create code You’ll also learn how to add objects called sprites and use code to tell them what to do At the end of each chapter you’ll find challenges to help you take your skills to the next level But before you start coding let’s learn a little about the website we’ll be using THE SCRATCH EDITOR The Scratch Editor is where you create projects in Scratch Here are its main parts Menus Use the File menu to save or load your projects Coding Area Drag and drop the blocks here and snap them together to create your program Start and Stop Click the green flag to start your code or the stop sign to stop it Stage Size Use these buttons to make the stage smaller set it to normal size or fill the screen The Stage Your program will run here Sprites Objects that move around on the stage Sprite Info Displays information about each sprite such as how big it is Code Blocks The code blocks in the current group are shown here Scroll down if you can’t find the block you want Tutorials Some help videos are shown here Click the white X to close this panel Sprite List All the sprites in your project are shown here The selected sprite has a blue border around it Choose a Sprite Add a new sprite to your project Choose a Backdrop Add a new background to your project Main Tabs Switch from coding drawing or adding sound Block Categories Code blocks in the Block Palette are sorted into colored groups Click a category to scroll to the blocks in that category viii viii
THE MAIN TABS Scratch has so many code blocks sprites and sounds to learn about Don’t panic you’ll learn how to use them in no time You’ll need to switch between the three main areas of the Scratch Editor while you’re creating your games These areas let you code change how your sprites look or add sound to a sprite The Code tab lets you drag code blocks into the coding area COSTUMES TAB Costumes Just as you have more than one set of clothes a sprite can have more than one look Scratch calls these looks costumes You’ll use different costumes to make simple animations New Costume Add a new costume to your sprite Click the Costumes tab to change how your sprite looks The Sounds tab allows you add a new sound to your project Fill Use this to set the color you’re drawing with Undo Click this if you make a mistake while you’re drawing Drawing Tools Use these to draw on your sprite Zoom Tools Use these to zoom in and add detail to your sprite costume Click Convert to Vector Bitmap to store images as vectors or bitmaps Vectors will look sharper but bitmaps are much simpler to create ix ix