Learning to Code with Scratch

As promised previously, I’ve written this to elaborate on our experience with Scratch as a learn to code resource. Scratch is ideally suited to younger learners because of its cartoon-y interface, but can also be used by teens or older. This post will endeavour to explain a little about Scratch and why it is so appealing to kids as a first programming experience.

Wikipedia has a good explanation of Scratch, but in summary it is a program designed to teach the fundamentals of programming to children. There are menus to select blocks of code which snap together. These blocks are then used to instruct objects in the program how to behave. Menu driven programming is a bit like having stabilizers on your bike when learning to cycle. There are some software products for grown ups that also use this methodology so it is a tried and trusted way to learn and makes it easier for children, thus avoiding some early frustrations.

Scratch in Summary

Requirements Any computer that has a browser. Can be installed locally on Windows, Mac or Linux. Not something you’d use on your smartphone Learning to Code with Scratch
Cost Free.
Independence Level Children can work through the material independently after the initial set up. Young children may need more assistance.
Target Beginner / ages 8 & up (although some eager younger kids may also have the aptitude)
Outcomes An understanding of how computer programs are written.
Resources The Scratch Website has plenty of tutorials, we used Super Scratch Programming Adventure. When the learner has reached a basic level of understanding they can explore other people’s code on the Scratch website. Our kids have recently started using the Scratch Resources website to get images to use in their code. 

 

Getting Started

To get started with the online version, you simply create an account on the site and use this to write your own programs in the browser. After you create a new project you are presented with a screen similar to the below image. There are three main areas to use in this screen:

  • The Stage Area displays the running of your program.
  • The Sprites Area allows you to select which sprite is being programmed.
  • The Code Area for each sprite allows you to select from the menu what actions each sprite should take.

Learning to Code with Scratch

 

Consider Scratch like a school play: The stage area is where you see the program running, the actors on the stage. The sprites area is the backstage area where actors get into costume. The code area is where the instructions are loaded for each sprite (there can be several) telling them how to behave in the stage area, which is like the actors having to practise and learn their lines.

Sprites can interact with each other and with themselves. Here is IrishCyborg’s explanation of the screenshot above.

 

Learning to Code with Scratch

 

A Kids View

To explain Scratch a little further I asked IrishCyborg, aged 12, some leading questions.

IrishDev: How do you code in Scratch?
IrishCyborg: There is a sprite area where it lists all the sprites, the stage area where it shows your program and an area for modifying the sprites. To code you drag out the blocks after picking which sprite to give the code to. You can also change how the sprite looks and sounds.

IrishDev: What is a sprite, it sounds like a fairy or mischievous elf?
IrishCyborg: A sprite is a collection of images which you add code to. You can have multiple sprites each of which can switch between images using code. Sprites are used for characters, enemies and anything else except for the background, which is a special sprite that cannot move.

IrishDev: How did you first start programming?
IrishCyborg: I started learning javascript on Khan Academy and codecademy. Then Mammy found Scratch which I tried and loved. I followed along with the Super Scratch book, it was very helpful because after I had finished I could reuse the code with modifications of my own.

IrishDev: What sort of things or activities do you think would help someone who would like to learn programming?
IrishCyborg: There are a lot of good books for learning, I think playing with Lego also helps, because it helps you see different ways of how things fit together. Also if you don’t have enough bricks you have to try to do it a different way. Looking at things from a different angle really helps. Painting and drawing are good if you want to have nice graphics for your game, or program.

IrishDev: What do you like about Scratch?
IrishCyborg: It’s easy to write programs because you just have to drag blocks out and modify them. Also, it has a nice graphics design editor and a huge library of pre-made images. I also like the way I can share my projects to the world.

IrishDev: What subjects that you had learned before starting programming, do you think helped you learn? What are good subjects to know first?
IrishCyborg: Well maths was a big help because Scratch uses a lot of maths, simple things like multiplication and addition but you can go farther with other calculations. I mostly use maths for positioning the sprites on the screen and for setting how they move. Playing with Lego also helped me, it made me more creative.

IrishDev: Is there anything you don’t like about Scratch?
IrishCyborg: There is no way to make things on the fly, you must create everything beforehand. In Scratch 2.0 they fixed this a little with clones, but it is still not possible to fully make things up as you need them. Other than that I can’t complain.

 

Games by a Kid

The following screens are some embedded games by IrishCyborg that can be played in your browser:

Learning to Code with Scratch Click the green flag at the top to start.
Learning to Code with Scratch Click the red stop sign to stop.
Use the arrow keys to move.

IrishDev : Tell me about your three favourite projects – what was your inspiration and what did you learn from them?
IrishCyborg:

Cake Frenzy is my favorite project:

My inspiration was from another Scratch user’s project (Pineapple Pursuit). You start by choosing a color, then run for the cakes by using the arrow keys. Some of the cakes have special powers like teleportation or poison. I learned about menus and restarting games.

Ultra Portal Maze is my second favorite:

In this game you control the guy to escape from a very big maze by going through portals. You need to keep your health and pass level 10 to win. I wanted to make a maze game but wasn’t sure how to make it scroll so I used portals to go between screens. I enjoyed making the different kinds of enemies. This was my first game where I learned to use the arrow keys.

 

Lolly Catch is my third favorite:

My inspiration for this was to make a sequel to cake frenzy. In this game you use the mouse to control your catcher after picking your color. You try to catch the lollies which are being fired at you. I got it to change backgrounds between games.
(this uses the mouse instead of arrow keys to move)

 

Other Posts in the ‘Kids that Code’ series.

Share This

Enter your email address to subscribe to this blog and receive notifications of new posts by email.