Memory game using Scratch| Step by step Scratch Tutorial

In this scratch tutorial, you will create a memory game in which you have to memorize
and repeat a random sequence of colors!

Before the tutorial starts, check out the game here https://scratch.mit.edu/projects/548409482/

Lets sketch out memory game in scratch

  • Create a colour sequence
  • Repeat the sequence
  • Multiple levels
  • High score
Memory Game On Scratch

Create a colour sequence

First create a character that can display a random sequence of colours and backdrop.

Give your character four different color costumes each representing different number. For example number 1 for red, 2 for yellow and so on…

Make sure that your coloured costumes are in the same order as the list above.

Next, add a list called ‘sequence’ for storing the random sequence of colours that the player has to remember. Make sure to choose For this sprite only when you create the list.

We already added the different number to each color, so you can choose a random colour by
randomly choosing a number and adding it to the list.

Each time a number gets added to the list, the character should change its costume so the costume’s colour matches the number.

Then, add sound each time the character sprite changes costume.

Repeat the sequence

Now you are going to add four buttons the player has to press to repeat the colour sequence. Same color as your character sprite costume.

program the red button sprite so that, when the sprite is clicked, it broadcasts a ‘red’ message to the character sprite.

When your character sprite receives the message red , the code should check whether the number 1 is at the start of the sequence list. If it is, the code should remove the number from the list, because the player remembered the correct colour. Otherwise game over, and the code needs to stop all to end the game.

Then program the sprite so that a drum beat also plays when the character sprite receives the correct broadcast .


When the player repeats the whole colour sequence correctly, the sequence list empty and the player wins. If you want, you can also display some flashing lights as a reward once the sequence list is empty.

Add Score and Multiple levels

So far, the player only has to remember a sequence of five colours. Improve your game by adding a score to the game.

Based on the score, the game will decide on the length of the colour sequence. Start with a score (and a sequence length) of 3 .

If the player repeats the correct sequence, you should add 1 to score , and doing so increases the length of the next sequence and the game moves to the next level and the colour sequence to remember becomes longer.

Test the code.

scrat

View Comments

Recent Posts

Create Your Own Super Mario Game in Scratch (Easy Step-by-Step)

Here's a step-by-step tutorial to create a platformer game similar to Super Mario in Scratch:…

4 weeks ago

Create a Fun Whack-a-Mole Game in Scratch: Step-by-Step Tutorial

Here's a step-by-step tutorial to create a Whack-a-Mole game in Scratch with code snippets: 1.…

4 weeks ago

Spot The Difference Game in Scratch

About Game: In Spot The Difference Game, the player has to spot the difference between…

3 years ago

How to make Flappy Bird on Scratch | Coding For Kids

In this article, we are going to teach you how to program your owncustomized version…

3 years ago

How to make Shooting Game on Scratch (Duck Hunt Game)

About Duck Hunt Game: This is a remake of the classic video game Duck Hunt.…

3 years ago

How to make a Snake Game on Scratch (step by step SCRATCH Tutorial 2021)

In this Tutorial, we attempt to make the popular snake game on Scratch About Snake…

3 years ago

This website uses cookies.