Augmented Reality in Scratch for Kids: A Guide

I am sure that many of you have played Pokemon Go and “caught” pets in parks, in entryways or in a children’s sandbox. The gameplay of this game is based on augmented reality (AR): through a smartphone camera, we see the real world in which digital objects appear, changing it. This game has excited children and adults all over the world. But this technology is used not only for entertainment and games. A good example is augmented reality glasses. Today, they are used in healthcare, industry, education, architecture and even sports.

Children, with their insatiable curiosity and thirst for adventure, are particularly receptive to technologies like AR. Here are a few examples of how augmented reality can be useful:

  1. AR turns boring learning into an exciting adventure. Imagine a child learning history not from dry textbooks, but by interacting with 3D models of ancient civilizations! Or learning anatomy with a virtual skeleton that can be rotated and viewed from all sides.

  2. AR makes everything around you alive and exciting. Kids can see a life-size dinosaur, fly a virtual airplane, or build a virtual house of their dreams. It sparks imagination and encourages creativity.

  3. Makes learning more effectiveChildren do not need to memorize information from books. They can immerse themselves in a virtual environment and gain practical knowledge by playing and exploring the world around them.

  4. New horizons for creativity. AR opens up opportunities for creative expression. Children create their own virtual worlds, draw in 3D, design clothes and much more. This develops imagination and allows the most daring ideas to be realized.

  5. This is the technology of the future, which is being actively introduced into various spheres of life. Children who are familiar with AR today will be prepared for the changes this technological advancement will bring. It will help children realize their potential and prepare for the future.

But it’s one thing to be a user of such technologies, and quite another to be able to create them. No matter how “magical” and complex AR may seem, even children who are just learning the basics of programming can create such technology on the Scratch visual programming platform.

Try to create such an AR project without using special programming knowledge.

Scratch lessons for kids: creating AR

Scratch is a visual coding platform. This means that when programming Scratch online, a child does not work with the computer code we are used to. Instead, he or she assembles a kind of constructor from blocks of different colors. Each color means a certain command and function. By combining them together in the right order, the child gets a working program. This can be a game, animation or cartoon.

Scratch programming for kids is very useful because it helps to learn the basics of coding. Scratch programming for kids helps to understand how algorithms work, what conditions are, how the coordinate system works, and much more.

So, our task for today is to create a game in which the ball will move randomly. Following the rules of AR technologies, we will be in the background through the computer camera. The main effect will be that when you touch the ball with your hand, it will blur. That is, our task is to catch the ball, for which points will be awarded.

Programming for children in Scratch: making preparations for the game

The first thing you need to do is go to the official website of the site: https://scratch.mit.edu/You can program directly on this site, no downloads required.

I am sure that such a lesson will be interesting for adults too. So I advise parents to join the process and try to make a joint game project with their child using AR technology.

Scratch programming for kids online: create a sprite

Next, we create our first sprite (in Scratch training for children, this is how any object with which one or another action is carried out is designated). You can do this through the icon at the bottom of the screen “Sprite” and the item “Select sprite”. Then the library will open. You can choose anyone or even upload your own character. In this Scratch lesson for children, I will focus on a basketball.

Make sure the sprite we selected is highlighted as in the screenshot.

Learn Scratch Programming for Kids for Free: Understanding the Event Block

Next, go to the “Code” tab and select the group highlighted in brown – “Events”. The “When clicked” block will be the beginning of our program. You can drag the block to the white field (scene) using LMB: hold down the key and do not release it until the block is in the desired area.

Scratch language for kids and working with variables

Our program has started. Next, we go to the orange block with variables (Variables). Click on the button that will be at the top: “Create variable”. We do this in order to add a device that will count the balls we catch. Here, in the variables, we select “Set value”. We transfer it to the stage under the block with the flag that is already there. After that, assign the variable the value 0.

Appearance Blocks in Scratch for Kids

From the Looks group, select the Hide block and place it sequentially below the first two blocks that we already have. Then return to Events and select Send Message. It is important to specify the Sphere Clone parameter for the latter (it will become clear why later).

Introduction to Cycles in the Scratch Lesson for Children

The “Control” group contains the next element needed for our game – the “Repeat Always” cycle. We substitute the “If, Then” condition into it. To finish working with the condition, go to the green “Operators” tab and select the sign where the value of the left parameter is greater than the right one (“>”). We need to substitute it into the “then” condition. We set the value of 30 to the parameter on the right. Literally, this means that something should be greater than “30”.

You may notice in our building program that we are not filling in some values. But this is temporary: we will return to them when the structure is ready.

Inside the condition block we will place “Pass a message”. In our case it will be “split the sphere”. We advise you not to think about why our game has such strange names for now.

As a result of working with the cycle, we should get it so that the message is transmitted when the “If” condition is met. Check if everything is the same as in the screenshot below. If so, then we move on. If you are confused about something, go back to the points above.

Scratch for kids online: we write a random trajectory of the ball

Let's recall one of the conditions of our game: the ball must move randomly across the screen, that is, randomly determine its next point. Let's write these conditions in our program. This is done using operators and assigning the corresponding values ​​to the x and y variables. So, if x is positive, the ball's trajectory has one direction, if negative, then another.

Perhaps you are working with the English version of the platform. Then the program with the last condition should look like the one in the picture below.

When the movement is finished, our sprite disappears from the screen. Using the “Transmit” block, we must add the same “sphere clone” message to the script. Then our ball will appear again.

Next, we will write the sprite algorithm in case of touching and interacting with the camera. And we will return to the event itself a little later.

So, if the message “sphere clone” is received, the pixels will become larger – for us, this will be the blur effect. Transfer all other characteristics to your code as shown in the picture.

To the part of the code that we created first, we need to add the second part. This way, it will always run with the message “clone sphere”.

Don't be afraid that you don't understand some part of the instructions now. Repeat all the steps and check the screenshots. This is especially true for those who have discovered programming lessons in Scratch for the first time. I am sure that the result will please you.

Scratch Programming Basics: Working with the Camera Extension

The Video Sensing extension will allow us to get an image from the camera. You can add it by calling the menu in the lower left corner of the window.

If you did everything correctly, you will see the broadcast from the camera on the right side of the screen. After that, a block for working with the camera will appear.

Now we need to go through those places of the code that remained empty:

  • at the beginning we put “Enable video”;

  • in the condition for launching the algorithm, where the random launch of the sprite is prescribed, we will set the convergence of the moving object in the video and the ball.

And this is the last step. Now you can run the program and watch how the sprite will react to the hand trying to catch it.

As you can see, AR is a really interesting technology. Children will be captivated not only by the process of the game itself, but also by its creation. It is good that even younger schoolchildren can do this, because Scratch is easy to manage, it is easy for children to work in it and master digital skills. If the instructions seemed difficult for you, I suggest watching a video tutorial on AR in Scratch and repeating all the steps step by step.


If you have already repeated our lesson or have had experience working with AR technology in another area, share your impressions in the comments!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *