HOW GAMES THINK

Learn how games follow instructions — and try Scratch for the first time!

Lesson: T1 — L06 Time: ~75 min Tool: Scratch Outcomes: G5-1, G5-2, G5-4
LEARNING SUPPORT VERSION

1 What Is Game Logic?

Words to Know

Logic
A set of rules that the computer follows — like a recipe for what to do
Code
Instructions written for a computer — tells the game what to do
Event
Something that happens — like pressing a key or clicking the mouse
Block
In Scratch, a coloured puzzle piece that gives one instruction
Sprite
In Scratch, a character or object on the screen
Every game follows instructions. When you press the right arrow key, the character moves right. When you press space, the character jumps. Someone had to write those instructions.
In this class, other students write instructions using C# code in Unity. It looks like this:
if (Input.GetKey("right")) { player.MoveRight(); }
We will use Scratch instead! Scratch uses colourful blocks that snap together like puzzle pieces. Same idea, but easier to see and understand!
when right arrow key pressed move 10 steps
Both do the same thing: "When the player presses the right arrow, move right." The only difference is how we write the instructions.
Talk to your partner: Can you think of 3 things that happen in a game when you press a button? (e.g. press A = jump)
I understand that games follow instructions, and Scratch uses blocks instead of typed code.

2 Getting Started with Scratch

Open your web browser and go to:
Type: scratch.mit.edu and press Enter You will see the Scratch website. It has an orange cat logo.
Create an account (or sign in if you already have one):
Step 1: Click Join Scratch (top-right corner). A sign-up window will appear.
Step 2: Choose a username (e.g. your first name + a number like Alex2026). Choose a password you will remember. Follow the steps to finish. You now have a Scratch account! You can save your projects.
Stuck on creating an account? Raise your hand. Your teacher or SLSO can help you set up your Scratch account.
Start a new project:
Step 3: Click Create at the top of the page. The Scratch editor opens! You will see an orange cat (the default sprite) on the right side of the screen.
Learn the Scratch screen. It has 3 main areas:
Left side — Block Palette: This is where all the colourful instruction blocks live. They are sorted by colour:
- Blue = Motion (moving)
- Purple = Looks (appearance)
- Yellow = Events (when something happens)
- Orange = Control (decisions, loops)
Middle — Coding Area: This is where you drag blocks to build your instructions. Blocks snap together like puzzle pieces.
Right side — Stage: This is where you see your game running. The cat lives here. Click the green flag to run your code. Click the red stop sign to stop.
I am logged into Scratch and I can see the cat, the blocks, and the stage.

3 Make the Cat Move!

Let's make the cat move when you press arrow keys. Follow these steps exactly:
Move RIGHT:
Step 1: In the Block Palette (left side), click on Events (yellow section). You will see yellow blocks appear.
Step 2: Find the block that says "when [space] key pressed". Drag it into the Coding Area (middle). The block appears in the coding area.
Step 3: Click the word space on the block. A dropdown menu appears. Choose right arrow. The block now says "when right arrow key pressed".
Step 4: Click on Motion (blue section) in the Block Palette. Blue blocks appear.
Step 5: Find "move [10] steps". Drag it and snap it under the yellow "when right arrow key pressed" block. The blocks snap together! Your first instruction is ready.
when right arrow key pressed
move 10 steps
Test it! Press the right arrow key on your keyboard. The cat should move to the right!
Cat not moving? Make sure the blocks are snapped together (no gap between them). Also make sure you clicked on the Stage area first.
I can press the right arrow key and the cat moves to the right!

4 Add Left, Up, and Down

Now add movement for all 4 arrow keys. You need to create 3 more block stacks:
Move LEFT:
1. Drag a new "when [left arrow] key pressed" event block
2. Snap a "move [-10] steps" block under it (change 10 to -10 — the minus sign means go backwards/left)
Tip: Click the number 10 in the move block and type -10 to make the cat move left. Negative numbers = move in the opposite direction.
Move UP:
1. Drag a new "when [up arrow] key pressed" event block
2. In the blue Motion blocks, find "change y by [10]" and snap it underneath
(y = up and down. Positive number = go UP)
Move DOWN:
1. Drag a new "when [down arrow] key pressed" event block
2. Snap a "change y by [-10]" block underneath
(Negative number = go DOWN)
Test all 4 directions! Press each arrow key and check the cat moves the right way.
Challenge your partner: Can you make the cat go to all 4 corners of the stage using only the arrow keys?
My cat can move in all 4 directions: right, left, up, and down.

5 Save and Name Your Project

Name your project:
Step 1: At the top of the screen, you will see text that says "Untitled". Click on it. The text becomes editable.
Step 2: Type: L06 - My First Scratch Project - [Your Name] Your project is named and saved automatically!
Extension (if you have extra time): Try changing the number of steps (e.g. 20 instead of 10) to make the cat move faster. What happens if you use 50? What about 2?
What I Learned
Write 1-2 sentences about what you learned today.
Today I learned that games follow instructions called... In Scratch, I made the cat...