Make Your Snake Move On Scratch!
Green highlight

Program a moving snake character in Scratch using sprites, costumes, and motion blocks to control direction, speed, and simple keyboard inputs.

Orange shooting star
Download Guide
Collect Badge
Background blob
Challenge Image
Skill Badge
Table of contents

Step-by-step guide to Make Your Snake Move On Scratch!

What you need
Keyboard, mouse, scratch (online or desktop)

Step 1

Open Scratch and start a new project so you have a blank stage to code on.

Step 2

Create a new sprite by using the Paint tool to draw a snake shape that you like.

Step 3

Make at least two costumes for your snake sprite so it can look like it is slithering.

Step 4

Add a "go to x: 0 y: 0" block and a "point in direction 90" block to set your snake's starting position and facing.

Step 5

Make a variable called "speed" for this sprite only so you can control how fast the snake moves.

Step 6

Attach a "when green flag clicked" block and put a "set speed to 5" block under it to start your game with a good speed.

Step 7

Put a "forever" loop block under the green flag script so the snake keeps moving all the time.

Step 8

Inside the forever loop add a "move (speed) steps" block so the snake travels based on the speed variable.

Step 9

Inside the forever loop add a "next costume" block and a "wait 0.15 seconds" block to make the snake animate as it moves.

Step 10

Inside the forever loop add an "if on edge, bounce" block so the snake turns when it reaches the edge of the stage.

Step 11

Add a "when right arrow key pressed" script that uses a "point in direction 90" block so the right arrow makes the snake go right.

Step 12

Add a "when left arrow key pressed" script that uses a "point in direction -90" block so the left arrow makes the snake go left.

Step 13

Add a "when up arrow key pressed" script that uses a "change speed by 1" block so the up arrow increases the snake's speed.

Step 14

Add a "when down arrow key pressed" script that uses a "change speed by -1" block so the down arrow decreases the snake's speed.

Step 15

Share your finished moving snake project on DIY.org so others can see and try your slithery creation.

Final steps

You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!

Complete & Share
Challenge badge placeholder
Challenge badge

Help!?

What can I use if the Paint tool or a custom sprite is hard to make?

If you can't use Scratch's Paint tool, pick a snake from the Scratch sprite library or upload a PNG and then duplicate and edit it to make the two slithering costumes.

Why won't my snake move or use the speed I set?

Make sure you created the 'speed' variable 'for this sprite only' and placed the 'set speed to 5' block under 'when green flag clicked' so the 'move (speed) steps' inside your forever loop has a value to use.

How can I adapt this activity for younger or older children?

For younger kids remove the 'speed' variable and use a simple 'move 5 steps' under 'when green flag clicked' with larger costumes, while older kids can keep 'speed', add diagonal 'point in direction 45 / -45' controls, and make the snake grow when it eats food.

How can we extend or personalize the moving snake project?

Add a food sprite and a 'score' variable with an 'if touching [food] then change score by 1; play sound; hide food; go to random position' script, plus new costumes or colors before sharing on DIY.org.

Watch videos on how to Make Your Snake Move On Scratch!

0:00/0:00

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Build a Snake Game in Scratch!

4 Videos

Facts about Scratch programming for kids

⌨️ Scratch can detect keyboard keys (like arrows) so you can steer your snake using simple 'key pressed' blocks.

⚡ Smooth movement in Scratch comes from small repeated steps or changing 'glide' and 'wait' timing — you control the speed!

🧩 Scratch uses colorful, snap-together blocks that make coding feel like solving a puzzle — perfect for beginners.

🎭 Sprites in Scratch can switch costumes to create animations without redrawing each frame.

🐍 The Snake video game became a worldwide hit after it was preloaded on many Nokia phones in the late 1990s.

How do I program a moving snake character in Scratch?

Start by creating a snake sprite with two or more costumes for animation. Use “when green flag clicked” to initialize position and a speed variable. In a forever loop, check keyboard inputs (arrow keys or WASD) and use “point in direction” and “move (speed)” or “change x/y by” blocks. Switch costumes and add a short wait to animate movement. Add edge handling (if on edge, bounce or wrap) and use variables to adjust direction and speed.

What materials do I need to make a moving snake in Scratch?

You need a computer or tablet with the Scratch website or offline editor, a keyboard and mouse/touchpad, and an internet connection for the online editor. A Scratch account is optional but useful for saving projects. Optional supplies: paper and pencils to sketch sprite ideas, headphones for sound, and an adult for supervision if the child is young or needs help signing up.

What ages is programming a moving snake in Scratch suitable for?

Scratch is best for children roughly 7–12 years old who can read basic instructions; younger kids (5–6) can try it with close adult help. Older kids and teens can use Scratch to explore more advanced features like variables, lists, and messaging. Adapt difficulty by providing step-by-step guidance for beginners or challenge experienced kids with extra features like AI movement or scoring systems.

What are the benefits and fun variations of making a moving snake in Scratch?

Building a snake game teaches sequencing, problem-solving, debugging, and basic event-driven programming. It boosts creativity when designing sprites and levels, and improves keyboard/mouse skills. For safety, supervise accounts, limit screen time, and encourage breaks. Fun variations: add food sprites and scoring, make a growing tail using clones, include obstacles, or change controls for two-player mode to extend learning and replay value.
DIY Yeti Character
Join Frame
Flying Text Box

One subscription, many ways to play and learn.

Try for free

Only $6.99 after trial. No credit card required

Make Your Snake Move On Scratch. Activities for Kids.