Game Design with Scratch
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).
What do you know about Scratch?
What block do you (almost) always start your code with?
Conditionals Review
In programming, what is a conditional statement?
Think back to your Choose Your Own Adventure story...
What were some places conditional statements could have been used in the example game?
Variables
Variable: a container that holds a value (information)
Example: books
Suppose I want to keep track of the number of books in the library...
Number of books we’re starting with
Buying a new book for the library
Oh no! We lost a book!
What do you think this code does?
What do you think this code does?
What do you think this code does? (look closely!)
If you’re making a game, what could you use a variable to keep track of?
What is the difference between “set to __” and “change by __”?
Planning Your Code
What is the “flow” of the game?
Choose 1 backdrop and 1 sprite
2 minutes to do this!
Make a variable to keep track of the score
Start your code
0
Ask the player questions
1
Math question
Correct answer
Player got question right
Player got question wrong
Ending the game
Number of questions
Player won
Player lost
To get started, go to scratch.mit.edu and sign in!