Maths detective: making a Scratch game
A mini detective challenge where children spot coordinates, loops and variables while making a Scratch game.
Quick answer
You can learn lots of maths while making a Scratch game, like using coordinates to move characters, loops to repeat actions, and variables to track scores.Learning outcome
By the end of this page, you will be able to make a simple Scratch game that uses maths concepts like coordinates, loops, and variables to move characters, repeat actions, and keep score. Success signs:- You can explain how coordinates help a character move on the screen
- You can use a loop to make something happen over and over
- You can make a variable that counts points or lives
- You can build a game where these maths ideas work together
Why this matters
When you make a Scratch game, you're using maths without even realising it! You're using coordinates to move your character, loops to make things happen again and again, and variables to count points or lives. These are the same maths ideas you use when you play games, go on a journey, or even when you're baking a cake. Understanding how these maths concepts work in games helps you see how useful maths is in everyday life.How it works
Making a Scratch game uses maths in simple ways:- Coordinates are like a map that tells your character where to go. You use numbers to say where on the screen something is.
- Loops let you make something happen over and over without writing the same code many times.
- Variables are like a box that holds numbers. You can change what's inside the box to keep score or track how many lives you have.
Examples you can see
Let's imagine you're making a game where you collect stars. Here's how maths helps:- Coordinates: If your character is at position (100, 50), that means 100 steps to the right and 50 steps up from the bottom-left corner of the screen.
- Loops: You can make your character move forward and turn right, and then repeat this action to make a square.
- Variables: You can create a variable called "score" that starts at 0. Each time you collect a star, you add 10 to your score.
Try it as a mini adventure
Adventure: The Star Collector Game You are a detective who needs to find a treasure. The treasure is hidden behind a star. You must:- Start your character at position (0, 0)
- Move your character to position (100, 50)
- Use a loop to make your character move forward 10 steps, then turn right, and repeat this 4 times
- Create a variable called "stars collected" that starts at 0
- When your character touches a star, add 1 to the stars collected
- Make your character say "I have collected X stars!" where X is the number of stars
Common mistakes
- Mistake: Forgetting to set the starting position of your character
Why it happens: The character might appear in the wrong place on the screen
Fix: Always set the position using "go to x: 0 y: 0" before moving - Mistake: Not using a loop to repeat actions
Why it happens: Writing the same code over and over makes your game messy
Fix: Use a "repeat" block to make actions happen multiple times - Mistake: Making a variable but not changing its value
Why it happens: The score or lives don't change when you collect items
Fix: Use the "change variable by" block to update the number
Parent and carer guide
As a parent or carer, you can help your child by:- Encouraging them to explain what each part of their game does
- Helping them think about how to make their character move using coordinates
- Practising loops by asking them to repeat actions like clapping or jumping
- Letting them make mistakes and find solutions themselves
- Showing them how these maths ideas are used in games they already enjoy
Practice questions
- What do coordinates tell you about where something is on the screen?
- How does a loop help you in a Scratch game?
- What is a variable in Scratch?
- How would you make a character move forward 10 steps and turn right, repeating this 4 times?
- What happens to your score when you collect a star?
- Coordinates tell you how far right and how far up something is on the screen
- A loop lets you repeat actions without writing the same code many times
- A variable is like a box that holds a number that can change
- Use a repeat block with 4 repetitions of "move 10 steps" and "turn right 90 degrees"
- Your score increases by 1 (or more) each time you collect a star
FAQ
What is Scratch?
Scratch is a free online programming tool where you can make games, animations, and stories by dragging and dropping blocks of code.
How do coordinates work in Scratch?
Scratch uses a coordinate system where (0, 0) is the middle of the screen. Positive x values go right, negative x values go left. Positive y values go up, negative y values go down.
Can I use loops in my Scratch game?
Yes! Loops let you repeat actions. You can use "repeat", "repeat until", or "forever" blocks to make things happen again and again.
What are variables in Scratch?
Variables are like boxes that hold numbers. You can create a variable like "score" or "lives" and change its value during your game.
Do I need to know maths to make a Scratch game?
No! You can make fun games without knowing advanced maths. You'll learn maths concepts naturally as you build your game.