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



Step-by-step guide to Make Your Snake Move On Scratch!
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!


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!
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.


Only $6.99 after trial. No credit card required