What Scratch is and what you can build with it

Scratch is a free visual programming environment where you build games by snapping together colored blocks instead of typing code. You do not need to install anything — you work in your web browser at scratch.mit.edu. The blocks represent actions: "move 10 steps," "wait 1 second," "if touching mouse-pointer then change color." You can make platformers, maze games, straightforward shooters, and turn-based games. You cannot build a 3D game or anything that requires real-time multiplayer, but for learning how games actually work, Scratch removes the barrier of syntax errors and lets you focus on logic.

Scratch runs on Windows, Mac, and Linux. You need a free account to save your work. The site hosts millions of projects, so you can study how other people solved problems and remix their code (with credit). The community is active and moderated, which matters if you are under 13 — Scratch has stronger privacy protections for younger users.

Key Takeaways

  • Create a free account at scratch.mit.edu, then start a new project to see the editor: a stage on the right, a sprite list on the left, and blocks in the middle.
  • Every game needs a sprite (a character or object), a script (blocks that tell it what to do), and a stage (the background where action happens).
  • Start with movement: use arrow keys to move a sprite, then add a second sprite that responds to a different key, then add collision detection so one sprite reacts when it touches the other.
  • Test constantly by clicking the green flag to run your game, and use the red stop button to pause — this is faster than rewriting code when something breaks.
  • Study existing games in the Scratch community to see which blocks other creators used, then remix or rebuild them to understand how each piece works.

Setting up your first project and understanding the editor layout

Go to scratch.mit.edu and click "Create" in the top left. You will see three main areas: the stage (white rectangle on the right, where your game runs), the sprite panel (bottom left, showing characters and objects), and the blocks palette (center left, organized by color and category). Above the stage is a green flag (start button) and a red stop button.

The default sprite is Scratch the cat. You can keep it, delete it, or upload your own image. For your first game, keep the cat. Click on it in the sprite panel to select it, then look at the blocks palette. You will see categories like "Motion" (blue blocks for movement), "Looks" (purple for appearance), "Sound" (pink), "Events" (orange, for when things happen), and "Control" (red, for loops and conditions). Drag a block onto the empty scripts area to the right of the palette and it snaps into place.

Making a sprite move with keyboard input

Click the "Events" category (orange blocks). Drag the block that says "when [green flag] clicked" onto your scripts area. This block runs everything connected to it when you press the green flag. Now click "Motion" (blue) and drag "change x by 10" underneath the flag block. They snap together. Change the "10" to "50" by clicking the number.

Now test: click the green flag above the stage. The cat moves 50 pixels to the right once, then stops. That is not a game yet — you need the cat to move while you hold a key. Delete the "change x by 10" block (drag it to the trash). Go to "Events" again and drag "when [space] key pressed" onto the scripts area. Attach "change x by 50" to it. Now click the green flag and hold the right arrow key. Nothing happens because the block says "space." Click the dropdown that says "space" and select "right arrow." Test again — the cat moves right as long as you hold the key.

Repeat for the other directions. Drag a new "when [right arrow] key pressed" block, attach "change x by 50." Then add "when [left arrow] key pressed" with "change x by -50" (negative moves left). Add "when [up arrow] key pressed" with "change y by 50" (up), and "when [down arrow] key pressed" with "change y by -50" (down). Test by pressing the green flag and using arrow keys. The cat now moves in all directions.

Adding a second sprite and making them interact

Your game needs something to happen when sprites touch. Click the "Choose a Sprite" button (bottom left, looks like a plus sign) and pick any sprite — a fish, a ball, an apple. It appears on the stage and in the sprite panel. Click on it to select it. In the scripts area, drag an "Events" block that says "when this sprite clicked." Attach a "Looks" block like "say Hello for 2 seconds." Test by clicking the green flag, moving the cat with arrow keys, and clicking the new sprite on the stage. It should say "Hello."

Now make the cat react when it touches the other sprite. Click on the cat in the sprite panel to select it. Go to "Control" (red blocks) and drag "if then" onto the scripts area. Click the diamond-shaped space in the "if" block — it opens a menu. Select "touching" and choose the name of your second sprite from the dropdown. Now drag a "Looks" block like "change color effect by 25" into the "then" slot. Wrap all of this in a loop so it checks constantly: go to "Control" and drag "forever" around the "if then" block. Attach the whole thing to "when [green flag] clicked."

Test: press the green flag and move the cat into the other sprite. The cat should change color. This is collision detection — the foundation of most games.

Building a straightforward game loop with scoring

A real game needs a goal. Let us make the cat collect the other sprite and keep score. Click on the second sprite (the one the cat touches). In its scripts area, drag "when this sprite clicked" and attach "hide." Now go to "Variables" (orange-red blocks) and click "Make a Variable." Name it "Score." A new block appears. Drag "set Score to 0" into the scripts area and attach it to "when [green flag] clicked." This runs once at the start.

Now click on the cat. Create a new script: "when [green flag] clicked" → "forever" → "if touching [second sprite] then" → "change Score by 1" and "wait 1 seconds." This adds 1 to the score every second the cat touches the sprite. Test it: the score goes up. But the sprite is still visible. Click on the second sprite again and add a script: "when [green flag] clicked" → "show." This makes it reappear at the start. Then add another script: "when this sprite clicked" → "hide" → "wait 2 seconds" → "show." Now when the cat touches it, the sprite disappears, the score goes up, and it reappears after 2 seconds. You have a playable game.

Saving, testing, and sharing your project

Click "File" in the top left and select "Save as." Give your project a name like "Cat Collector." Scratch saves it to your account automatically after that. Every time you make a change, it saves. Click the green flag often to test. If something breaks, click the red stop button, look at your blocks, and find the mistake. Common problems: a block is not snapped to another block (drag it closer), a variable name is spelled differently in two places (check the dropdown), or a sprite is hidden and you forgot to show it.

When you are ready to share, click "Share" in the top right. Your project gets a link that anyone can view and remix. You can also study other people's projects by clicking "See inside" on their page — this shows you all their blocks and how they organized them. This is one of the fastest ways to learn: find a game similar to what you want to build, remix it, and change one block at a time to see what happens.

Common problems and how to fix them

If a sprite does not move when you press a key, check that the block says the right key in the dropdown. If the sprite moves but gets stuck at the edge of the stage, add a "if on edge, bounce" block from "Motion" — this turns it around. If the score goes up too fast, add a "wait" block after "change Score by 1" so it does not count the same touch multiple times.

If you want the sprite to face the direction it is moving, go to "Motion" and change the "rotation style" dropdown from "all around" to "left-right." If you want to add sound, go to "Sound," click "Choose a Sound," pick one, and drag "play sound [name] until done" into your script. If the game is too straightforward or too hard, change the numbers: make the sprite move faster (increase the "change x by" amount) or slower (decrease it), or make the target sprite move randomly by adding "go to random position" from "Motion."

Frequently Asked Questions

Can I use my own drawings or photos as sprites?

Yes. Click the sprite button and select "Upload Sprite." You can upload a PNG, JPG, or SVG file from your computer. Keep the image small (under 500 pixels wide) so it loads fast. If your image has a white background and you want it transparent, use a free tool like photopea.com to remove the background before uploading.

How do I make a sprite follow the mouse?

Go to "Motion" and drag "point towards [mouse-pointer]" into a "forever" loop attached to "when [green flag] clicked." Then add "move 5 steps" below it. The sprite will chase your cursor. Change "5" to make it faster or slower.

Can I add music or background sounds to my game?

Yes. Click "Sound" in the top menu of the editor, then click "Choose a Sound." Scratch has a library of free sounds. You can also upload your own MP3 or WAV file. Drag "play sound [name]" into a script that runs when the game starts, or attach it to a specific event like "when this sprite clicked."

What should I build after my first game?

Make a maze where the player moves a sprite through a path without touching the walls. Add a timer that counts down and ends the game when it reaches zero. Build a two-player game where one person uses arrow keys and another uses WASD. Study a Scratch game you like, remix it, and change the sprites and rules. Each small change teaches you how a different block works.

Is Scratch good enough to learn real programming?

Scratch teaches the logic that all programming languages share: variables, loops, conditionals, and events. When you are ready to move to Python or JavaScript, you will recognize these same ideas in text form. Many professional programmers started with Scratch or something similar. It is a real foundation, not a toy.