1 of 33

Game Design with Scratch

2 of 33

By the end of today, you will...

Know/remember how to use conditionals in Scratch

Know how to keep track of values using variables

Create a game to practice math facts using Scratch

DLCS 3-5.CT.d.1 Individually and collaboratively create, test, and modify a program in a graphical environment

MA DLCS 3-5.CT.d.4 Recognize that programs need known starting values (e.g., set initial score to zero in a game).

3 of 33

4 of 33

What do you know about Scratch?

5 of 33

What block do you (almost) always start your code with?

6 of 33

7 of 33

Conditionals Review

8 of 33

In programming, what is a conditional statement?

Think back to your Choose Your Own Adventure story...

9 of 33

10 of 33

What were some places conditional statements could have been used in the example game?

11 of 33

Variables

12 of 33

Variable: a container that holds a value (information)

13 of 33

Example: books

Suppose I want to keep track of the number of books in the library...

14 of 33

Number of books we’re starting with

15 of 33

Buying a new book for the library

16 of 33

Oh no! We lost a book!

17 of 33

What do you think this code does?

18 of 33

19 of 33

What do you think this code does?

20 of 33

21 of 33

What do you think this code does? (look closely!)

22 of 33

23 of 33

If you’re making a game, what could you use a variable to keep track of?

24 of 33

25 of 33

What is the difference between “set to __” and “change by __”?

26 of 33

Planning Your Code

27 of 33

What is the “flow” of the game?

28 of 33

Choose 1 backdrop and 1 sprite

2 minutes to do this!

29 of 33

Make a variable to keep track of the score

30 of 33

Start your code

0

31 of 33

Ask the player questions

1

Math question

Correct answer

Player got question right

Player got question wrong

32 of 33

Ending the game

Number of questions

Player won

Player lost

33 of 33

To get started, go to scratch.mit.edu and sign in!