Scratch maths: score graphs
Use Scratch projects to record game scores and make charts from playtests.
Quick answer
You can use Scratch to make a project that records game scores and shows them in a bar chart or graph, so you can see how well you or your friends are doing.Learning outcome
By the end of this page, you will be able to create a simple Scratch project that records scores from a game and shows them in a bar chart or graph. Success signs:- You can make a Scratch project that records a score
- You can show your score on a bar chart in Scratch
- You can use your project to compare different scores
- You can add your own ideas to make the chart more fun
Why this matters
When you play games, it's fun to see how you're doing compared to others. In Scratch, you can make a project that keeps track of your scores and shows them in a chart. This helps you understand how your scores change over time. It's like making a scoreboard for your games, and it's a great way to learn about data and how to show information clearly. This skill helps you understand how to make charts and graphs, which you’ll use in school and in real life when you need to show how things are changing.How it works
Making a score graph in Scratch is like building a scoreboard. You need to:- Set up a variable to store the score
- Use a loop to keep asking for scores
- Draw a bar chart to show the scores
- Use a sprite to move up and down to show the score
Examples you can see
Imagine you're making a game where you collect coins. You want to see how many coins each player gets. Here’s how it works in Scratch:- Player starts with 0 coins
- Player collects 5 coins
- Player collects 3 more coins
- Player collects 7 more coins
| Player | Coins | Bar Height |
|---|---|---|
| Player 1 | 5 | 50 pixels |
| Player 2 | 3 | 30 pixels |
| Player 3 | 7 | 70 pixels |
Try it as a mini adventure
Adventure: The Score Tracker Challenge You are the game designer for a new game where players collect stars. You need to make a Scratch project that records how many stars each player gets and shows it in a bar chart.- Start a new Scratch project
- Create a variable called stars
- Make a sprite that will be your bar chart
- Use a loop to ask how many stars each player gets
- Change the sprite’s y position to show the number of stars
- Make the chart look fun with colors and sounds
Common mistakes
- Mistake: Forgetting to reset the score variable between players
Why it happens: The variable keeps the same number from the last player.
Fix: Add a set score to 0 block before each new player. - Mistake: Making the bars too small or too big
Why it happens: Not thinking about how to scale the bars to fit on the screen.
Fix: Use a change y position block with a number that makes the bars fit nicely. - Mistake: Not using a loop to collect multiple scores
Why it happens: Only asking for one score.
Fix: Use a repeat block to ask for scores several times.
Parent and carer guide
As a parent or carer, you can help your child by:- Encouraging them to think of a simple game they like to play
- Helping them make a plan for how to record scores
- Letting them try different ways to make the bars look interesting
- Asking them to explain how their project works
- Practicing with different numbers to see how the bars change
- What happens when you change the number of stars?
- How can you make the chart look clearer?
- Can you make it show more than one player?
Practice questions
- What is the name of the variable you use to store a score in Scratch?
- How can you make a bar chart show a score?
- What block do you use to change how high a bar is?
- Why do you use a loop in a score graph?
- How can you make your graph look more fun?
- Score
- By changing the y position of a sprite
- Change y position
- To ask for multiple scores
- With colors, sounds, or a title
FAQ
What is a score graph in Scratch?
A score graph in Scratch is a way to show how many points a player has by using a bar chart. You can make a project that records scores and shows them visually.
Can I use a score graph for any game?
Yes, you can use a score graph for any game where you keep track of points or scores. It works for games like football, racing, or collecting items.
How do I make the bars show the right size?
You can use a change y position block to make the bars go up and down. You can also use a multiply block to make the bars bigger or smaller.
Do I need to know how to code to make a score graph?
Yes, you need to know how to use basic blocks like set, change, repeat, and if to make a score graph in Scratch.
Can I make a score graph with more than one player?
Yes, you can make a score graph for many players by using loops and variables for each player.