Chapter 3. Meeting Scratch’s key blocks through important coding concepts

 

You want to make the games, right? I know. I want to jump straight to the game making too. But I also know that learning key computer science ideas first will make that whole game-making thing a lot easier. It will help you jump into the coding in this book, help you design your own games in the future, and even help you learn another coding language, such as Python or JavaScript. The ideas covered in this chapter apply to every programming language and every game you’ll ever make.

Think of this chapter as the first day of school, and you’re meeting your new classmates—except your classmates happen to be computer science concepts instead of humans. As you build the games and put these ideas into practice, you’ll get to know them better. In fact, you’ll re-meet these eight computer science ideas in every game you make in this book, so you’ll know them quite well by the last chapter.

Here’s what you’ll encounter in this chapter:

  • How to use the eight most common blocks you’ll need to build games, and how these eight common blocks are tied to key computer science concepts
  • How to make eight mini scripts to see computer science in action

You’ll find all the blocks you need to meet in the center Block Menu. What are the eight most commonly used blocks, and what do they do inside a game? See table 3.1.

Starting a program with the When Flag Clicked block

Setting location with X and Y coordinates

Answer This: How Do You Position the Cat 100 Spaces Below Center?

Using a conditional statement

Making loops

Using variables

Using Booleans

Cloning sprites

Answer This: How Can You Keep the Cats from Flipping Upside Down?

Broadcasting messages

Learning in action

sitemap