How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (2025)

Snake Game: Scratch games are visually fun and interactive ways of learning coding and game development, especially for children between the ages of 8 to 16. A Snake game on Scratch can be of different types depending on the sprite’s movement, objective, and rewards. In this blog, we will discuss how to code a Snake game on Scratch 3.0.

This is Chapter 2.4 in the
Scratch Game Tutorial

Looking to learn Scratch coding? Explore Wiingy’s Online Scratch Coding Classes For Kids to learn from top Scratch coding experts.

What is a snake game on Scratch?

A snake game is where you make a snake game on Scratch. In this Scratch game, we will be using the up/down/left/right arrow keys to move the snake. The Snake Game on Scratch will be created based on the following conditions:

  1. If Snake collides with the “food” sprite (a non-moving sprite), then the snake will grow.
  2. The game will end if the snake runs on the wall or touches the wall.

The detailed steps involved in creating this game on Scratch are explained below:

There are six following steps to make this game.

  1. Draw a square for your snake sprite
  2. Draw a food sprite
  3. Make the snake Move
  4. Draw the food sprite and set the position & function
  5. Keep score
  6. Add game over

How to snake game on Scratch 3.0?

The detailed step-by-step process involved in making the Scratch snake game is explained below:

Step 1: Draw a square for your snake sprite on Scratch

  • Click on the “Costumes” option as shown in the image given below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (1)
  • Delete the “costume2” as shown in the image given below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (2)
  • Click on “Reshape” to reshape the Scratch.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (3)
  • Drag your mouse pointer over the car as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (4)
  • Drop the mouse pointer, and now the cat image is selected.
  • Press the “Delete” key or click on the “Delete” icon as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (5)

Step 2: Draw a food sprite on Scratch for snake game

  • Click on “Fill” to choose a color.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (6)
  • Drag and adjust the “Color”, “Saturation”, and “Brightness” as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (7)
  • Click on the “circle” icon
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (8)
  • By dragging the mouse pointer over the paint area to draw a circle; the size could be any.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (9)
  • Drop the mouse pointer.
  • Again click on “Circle”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (10)
  • Select the color by adjusting the “Color”, “Saturation”, and “Brightness” as shown below
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (11)
  • Drag the mouse pointer and draw a small circle within the green circle.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (12)

Step 3: Make the snake move in the Scratch game

  • Let’s control the snake using the up/down/left/right arrow keys in this game. The steps to do this are explained below:
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (13)
  • Change the sprite name and name it “snake”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (14)

Let’s add a backdrop to the game.

  • Click on the “Choose a Backdrop” icon as shown in the image given below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (15)
  • Click on “Blue Sky 2”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (16)
  • Backdrop added.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (17)
  • Set the starting position of the snake.
  • Drag & drop “when green flag clicked” & “go to x y”
  • Set the start position as (0, 0).
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (18)
  • Create a variable to store directions.
  • Click on “Variables” and click on “Make a Variable”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (19)
  • Name your variable and click on “OK”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (20)
  • Drag & drop “set direction to” block and write value “right”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (21)
  • Drag & drop the “when space key pressed” block as shown below.
  • Click on the dropdown and select “right arrow”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (22)
  • Similarly assign the direction for the left, up, and down.
  • Drag & drop “when key pressed” and “set direction to” blocks as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (23)
  • Set the direction of the snake when the game starts.
  • Drag & drop “set direction to” and set the direction right.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (24)
  • Add a conditional statement to check whether the right arrow key is pressed.
  • Drag & drop “if-then”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (25)
  • Drag & drop the “equal to” operator as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (26)
  • Drag & drop the “direction” variable to the “equal to” operator as shown below.
  • Write the “right” to “equal to” operator.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (27)
  • Change the snake’s x position to a positive value so that the snake can move in the right direction when you press the right arrow key.
  • Drag & drop the “change x by” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (28)
  • Put the conditional statement in a “forever” loop, checking it each time.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (29)
  • Click on the “green flag”.
  • The snake can move in the right direction by pressing the right arrow key.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (30)
  • Similarly, add another conditional statement for the “left” arrow key.
  • Drag & drop “if-then”, “equal to” and “direction” variables as shown below.
  • To move the snake in the left direction change the snake x position value with a negative number.
  • Drag & drop the “change x by -5” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (31)
  • Similarly, add another conditional statement for the “up” arrow key.
  • Drag & drop “if-then”, “equal to” and “direction” variables as shown below.
  • To move the snake in the up direction change the snake y position value with a positive number.
  • Drag & drop the “change y by 5” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (32)
  • Similarly, add another conditional statement for the “down” arrow key.
  • Drag & drop “if-then”, “equal to” and “direction” variables as shown below.
  • To move the snake in the up direction change the snake y negative value with a positive number.
  • Drag & drop the “change y by -5” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (33)
  • Click on the “green flag”.
  • Snake can move in left/right/up/down direction using left/right/up/down keys.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (34)

Let’s add some effects so that the snake sprite mimics a snake.

  • Drag & drop the “create clone of myself” block as shown below.
  • Click on the “green flag”.
  • Snake can move in left/right/up/down direction using left/right/up/down keys and its length is increasing but we do not want to increase length automatically.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (35)
  • Let’s program the clone of the snake.
  • Drag & drop the “when I start as a clone”, and “wait seconds” blocks as shown below.
  • Set the wait time at 0.1, you can choose any; please note this wait time will decide the length of the snake.
  • Drag & drop the “delete this clone” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (36)
  • Click on the “green flag”.
  • Snake can move in left/right/up/down direction using left/right/up/down keys and its length is not increasing automatically.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (37)

Step 4: Draw the food sprite and set the position and function

  • Click on “Paint”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (38)
  • Click on “Fill” and select your color.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (39)
  • Click on the “Circle” icon of the scratch paint tool.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (40)
  • Drag the mouse pointer over the paint area and create a circle.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (41)
  • Add outline to food sprite.
  • Click on “Outline”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (42)
  • Select your outline color.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (43)
  • Click on “Reshape” to select it then click on the “red circle”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (44)
  • Set the outline thickness to five.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (45)
  • Change the design of the “red circle” so that it looks like foody stuff by dragging the outline.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (46)
  • Click on fill and select color, then click on “circle”
  • Drag the mouse pointer over the “red circle” and draw a small circle within the “red circle”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (47)
  • Let’s code the food sprite and set its position and functions.
  • Click on “Code”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (48)
  • Change the food sprite name and size.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (49)
  • Set the start position of the food sprite.
  • Drag & drop “when green flag clicked” and “go to x y” blocks as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (50)
  • X, Y value of scratch stage.
  • X value range is from -240 (left) to 240 (right).
  • Y value range is from 180 (up) to -180 (down).
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (51)
  • Make the position random by using the “pick random to” block.
  • Drag & drop “pick random to” block to x and y and set its value,
  • And set the x value from -240 to 240 & y value from 180 to -180 as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (52)
  • Write a conditional statement to check whether the food sprite touches the snake sprite.
  • Drag & drop “if-then” and “touching” blocks as shown below, click on “dropdown” and select “snake”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (53)
  • If the snake touches (eat) the food then change its position to a random position.
  • Drag & drop the “go to x y” and “pick random” blocks as shown below.
  • And set the x value from -240 to 240 & y value from 180 to -180 as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (54)
  • Put the above conditional statement into the “forever” loop.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (55)
  • Click on the “green flag”.
  • The snake can eat the food, and then the food changes its position to a random place.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (56)
  • Now, let’s increase the snake length when the snake touches the food sprite.
  • Create a variable, click on “Variables” and, then click on “Make a Variable”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (57)
  • Name the variable then click on “OK”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (58)
  • Click on the “snake” sprite.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (59)
  • Drag & drop the “length” variable to the “wait seconds” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (60)
  • Change the “length” variable when the snake touches the food.
  • So, first, click on the “food” sprite.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (61)
  • Drag & drop the “change direction by” block as shown below.
  • Click on the “length”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (62)
  • Change the “change length by” value by 0.1 when “snake” touches the “food” sprite.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (63)
  • Click on the “green flag”.
  • Now, snake length increase by 0.1 when it touches the food.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (64)

Step 5: Add score to the snake game

Let’s add a score in the game when the snake touches the food.

  • To keep track of scores create a variable.
  • Click on “Variables” and, then click on “Make a Variable”
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (65)
  • Name the variable then click on “OK”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (66)
  • Drag & drop the “change direction by” block as shown below.
  • Click on the dropdown and select “score”.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (67)
  • Change the score variable value by 10.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (68)
  • Click on the “green flag”.
  • Now, the score increase by 10 when the snake touches the food.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (69)
  • Let’s set the snake length & the score to zero when the game starts.
  • Click on the “snake” sprite.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (70)
  • Drag & drop “set the score to” and “set length to” blocks as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (71)
  • Click on the “green flag”.
  • Now, length and score start with zero when the game starts.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (72)

Step 6: Add a game-over message

Let’s add game-over features to the game; if the snake touches the edge of the scratch stage, the game will be over.

  • Add a conditional statement to check whether the snake touches the edge of the scratch stage.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (73)
  • Drag & drop “say for seconds” block and set the game over message.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (74)
  • Drag & drop the “stop all” block as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (75)
  • Put the conditional statement into the “forever” loop.
  • Drag & drop the “when green flag clicked” block on top as shown below.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (76)
  • Click on the “green flag”.
  • Now, if the snake touches the scratch stage edge then the game stops and displays the game-over message.
How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (77)

Congratulations, You have completed the Snake game in Scratch.

Snake game code in Scratch?

The scratch game code for both snake and the food sprite are explained below:

Snake game code for snake sprite

How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (78)

Snake game code for food sprite

How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (79)

Time to Play!

  • Congratulations, You have completed the Snake game in Scratch!
  • Click on “green flag” to start playing the Snake game. What are the enhancements to the game you can think of? Do let us know in the comments section below.

Looking to learn Scratch coding? Explore Wiingy’s Online Scratch Coding Classes For Kids to learn from top Scratch coding experts.

How to create a snake game on Scratch?
Follow the steps given below to create a snake game on SCratch:

  1. Draw a square for your snake sprite
  2. Draw a food sprite
  3. Make the snake Move
  4. Draw the food sprite and set the position & function
  5. Keep score
  6. Add game over

What is the easiest game on Scratch?
The maze game can be considered an easy game to make on Scratch. The user needs to navigate the sprite through a complicated maze while avoiding the maze boundary and different sudden obstacles.

What is the most popular game on Scratch?
The most popular game on Scratch is Paper Minecraft v11.6 (Minecraft 2D). It has over 35000 hearts.

We hope this detailed article on how to create a Snake Game on Scratch is helpful to you. Do try creating this game on Scratch and let us know if it worked for you on Scratch. Also, if you have any queries regarding this game, then ping us through the comment box below and we will be happy to assist you.

Want to make more such games? Check out our beginner-friendly guide to Scratch games.

How To Create Snake Game on Scratch? - Step by Step Tutorial - Wiingy (2025)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Carmelo Roob

Last Updated:

Views: 6151

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.