You use maths when making a Scratch game
A short, exciting page showing children how making a Scratch game already uses coordinates, loops and variables.
Quick answer
When you make a Scratch game, you use maths without even realising it! You use coordinates to move your characters, loops to repeat actions, and variables to keep track of scores.Learning outcome
By the end of this page, you will understand how making a Scratch game uses maths like coordinates, loops, and variables – and you’ll be able to spot these maths ideas in your own game designs. Success signs:- You can explain how to move a character using coordinates
- You can show how a loop makes a character repeat an action
- You can tell what a variable is and how it helps in a game
- You can imagine making your own game using these maths ideas
Why this matters
Making Scratch games is super fun, but it also helps you learn important maths. You don’t need to know the names of these maths ideas – you’re already using them when you code! Understanding how maths works in games helps you think more logically, plan better, and even solve problems faster. This is the start of learning how to code and how to think like a mathematician.How it works
When you make a Scratch game, you use three main maths ideas:- Coordinates – These tell your character where to go on the screen (like a map).
- Loops – These let your character do the same thing over and over.
- Variables – These are like labels that help you keep track of things like scores or lives.
Examples you can see
Let’s imagine you’re making a game where a character needs to collect stars. Here’s how maths helps: 1. Coordinates To move your character, you need to tell it how far to go left or right, and how far up or down. In Scratch, this is done with X and Y numbers.- Example: If your character starts at X = 100 and Y = 50, and you tell it to go to X = 150, Y = 50, it moves 50 steps to the right.
- Example: A loop can make your character walk 10 steps forward, then 10 steps back, and do this 5 times.
- Example: You make a variable called “Stars” and every time your character collects a star, you add 1 to the variable.
Try it as a mini adventure
Adventure: Build Your Own Star Collector Game! You are a game designer, and your job is to make a game where a character collects stars. Here’s your challenge:- First, you place your character on the screen using coordinates.
- Then, you make your character move in a pattern using a loop.
- Finally, you make a variable to count how many stars your character collects.
- Step 1: Place your character at X = 0, Y = 0.
- Step 2: Use a loop to make your character move 10 steps right, then 10 steps left, 3 times.
- Step 3: Create a variable called “Stars” and set it to 0.
- Step 4: When your character touches a star, add 1 to the “Stars” variable.
Common mistakes
- Mistake: Forgetting to set up a variable before using it.
Why it happens: It’s easy to forget that you need to create a label for your score or lives.
Fix: Always create your variable first, then use it in your code. - Mistake: Thinking that loops always make characters go in circles.
Why it happens: Loops can make characters do many different things, not just circles.
Fix: Try different actions inside your loop – like moving, jumping, or changing costumes. - Mistake: Confusing X and Y coordinates.
Why it happens: X is left-right, and Y is up-down – it can be tricky to remember.
Fix: Draw a simple grid and label X and Y to help you remember.
Parent and carer guide
Parents and carers can help by:- Encouraging children to explain what they’ve made in their Scratch game
- Helping them think about how coordinates work in everyday life (like maps or games)
- Letting children experiment with loops by having their character move in different patterns
- Using simple examples like "If you have 5 apples and eat 2, how many are left?" to introduce variables
- Not worrying if the child doesn’t get it right the first time – that’s part of learning!
Practice questions
- What is a coordinate in Scratch?
- How does a loop help in a game?
- What is a variable, and why do we use it?
- If your character starts at X = 100 and moves 50 steps right, what is its new X position?
- How can you use a variable to track a player’s score?
- A coordinate tells a character where to go on the screen (like X and Y numbers).
- A loop makes the character do the same action over and over without writing the same code again.
- A variable is a label that holds a number, like a score or lives, so it can change during the game.
- Its new X position is 150.
- You can create a variable, like “Score,” and add 1 each time the player gets a point.
FAQ
What is a coordinate in Scratch?
A coordinate is a pair of numbers (X and Y) that tells a character where to stand or move on the screen.
How do loops help in games?
Loops help by making actions repeat, like walking back and forth or collecting items over and over without writing the same code again.
Can I use variables in any Scratch game?
Yes! Variables are used in almost every game to track scores, lives, or other important numbers.
Do I need to know maths to make a Scratch game?
No! You can make a fun game using maths ideas without even realising it. The more you play, the better you’ll get at using maths in your games.
How can I make my game more interesting with maths?
You can use loops to make cool movement patterns, coordinates to move characters exactly where you want, and variables to track scores or lives to make your game more exciting.