0 = x } 0 1 : ) 1 0 ( = 0 * > 1 0 = / o n g i 0 1 ( 1 * y 1 : i C D m a e G S SCRATCH IN ™ x 0 1 0 1 0 1 = 0 1 0 : 1 : * 1 y * x ) 0 A STEP-BY-STEP VISUAL GUIDE TO BUILDING YOUR OWN COMPUTER GAMES o n g C D m a e G S SCRATCH IN ™ o n g C D m a e G S SCRATCH IN ™ JON WOODCOCK DK UK Senior editor Ben Morgan Project art editor Laura Brim Editors Lizzie Davey, Ashwin Khurana, Steve Setford US editors Jill Hamilton, Margaret Parrish Designers Mabel Chan, Peter Radcliffe, Steve Woosnam-Savage Jacket design development manager Sophia MTT Jacket editor Claire Gell Producer, pre-production Francesca Wardell Producer Mary Slater Managing editor Paula Regan Managing art editor Owen Peyton Jones Publisher Andrew Macintyre Associate publishing director Liz Wheeler Art director Karen Self Design director Stuart Jackman Publishing director Jonathan Metcalf DK DELHI Project editor Suefa Lee Project art editor Parul Gambhir Editor Sonia Yooshing Art editors Sanjay Chauhan, Upasana Sharma Assistant art editor Simar Dhamija Senior DTP designers Harish Aggarwal, Vishal Bhatia Senior managing editor Rohan Sinha Managing art editor Sudakshina Basu Pre-production manager Balwant Singh Jacket designer Suhita Dharamjit Managing jackets editor Saloni Singh First American Edition, 2016 Published in the United States by DK Publishing 345 Hudson Street, New York, New York 10014 Copyright © 2015 Dorling Kindersley Limited DK, a Division of Penguin Random House LLC 16 17 18 19 20 10 9 8 7 6 5 4 3 2 1 001—283034—January/2016 All rights reserved. Without limiting the rights reserved under copyright above, no part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the copyright owner. Published in Great Britain by Dorling Kindersley Limited. A catalog record for this book is available from the Library of Congress. ISBN: 978-1-4654-3935-2 DK books are available at special discounts when purchased in bulk for sales promotions, premiums, fund-raising, or educational use. For details, contact: DK Publishing Special Markets, 345 Hudson Street, New York, New York 10014 or [email protected] Printed in China A WORLD OF IDEAS: SEE ALL THERE IS TO KNOW www.dk.com DR. JON WOODCOCK MA (OXON) has a degree in physics from the University of Oxford and a PhD in computational astrophysics from the University of London. He started coding at the age of eight and has programmed all kinds of computers, from single-chip microcontrollers to world-class supercomputers. His many projects include giant space simulations, research in high-tech companies, and intelligent robots made from junk. Jon has a passion for science and technology education, giving talks on space and running computer programming clubs in schools. He has worked on numerous science and technology books as a contributor and consultant, including DK’s Computer Coding for Kids and Computer Coding Made Easy. Contents 8 FOREWORD CHEESE CHASE 50 How to build Cheese Chase COMPUTER GAMES Score 30 High Score 90 12 What makes a good game? 14 Atmosphere 16 Types of games 18 How coding works GETTING STARTED CIRCLE WARS 22 Introducing Scratch 74 How to build Circle Wars 24 Getting Scratch 26 Scratch tour Score 8 Time 23.5 STAR HUNTER 30 How to build Star Hunter Score 0 JUMPY MONKEY 90 How to build Jumpy Monkey SET LAUNCH ANGLE SET LAUNCH SPEED SPACE TO FIRE LaunchSpeed 11 DOOM ON THE BROOM TROPICAL TUNES 108 How to build Doom on the Broom 190 How to build Tropical Tunes Score 25 Lives 3 Score 0 DOG’S DINNER WHAT NEXT? 130 How to build Dog’s Dinner 206 Remixing and beyond 208 Better Scratch 210 The next level 212 Jobs making games 214 Have fun! GLOSSARY & INDEX 218 Glossary GLACIER RACE 220 Index 224 Acknowledgments 166 How to build Glacier Race Ben Gems: 20 Countdown 11 Laura Gems: 13 Find out more at: www.dk.com/computercoding Foreword Many of the people who have shaped our digital world started out by coding games for fun. Bill Gates, cofounder of Microsoft, wrote his first computer program at the age of 13—a tic tac toe game. Just a few years later a teenage Steve Jobs and his friend Steve Wozniak, who later founded Apple together, created the arcade game Breakout. They started coding simply because they enjoyed it. They had no idea how far it would take them or that the companies they were to build would change the world. You might be the next one like them. Coding doesn’t have to become a career, but it’s an amazing skill and can unlock exciting doors to your future. Or you might just want to play around with code for the fun of it. Computer games open up worlds of imagination. They reach out across the internet and allow us to play together. They are packed with creativity, from music, stories, and art to ingenious coding. And we’re hooked on them: so much so that the games industry is now worth more than the movie industry. It’s huge.