How to make a Snake Game on Scratch (step by step SCRATCH Tutorial 2021)

In this Tutorial, we attempt to make the popular snake game on Scratch

About Snake Game:

The player controls a snake, whose main goal is to eat apple appearing at random position on the screen. The more Apple snake eats, the longer it gets, and the harder it becomes to keep the snake from crushing its own tail. If that happens, Game will be over.

For this game we need 2 sprites.

  1. Apple: The snake will try to eat this.
  2. Snake: This is what player control.

Sketchout the Snake Game:

Lets sketch out the snake game.

  1. Make the Snake Controlled by Arrow Key
  2. Make Apple appear at random position
  3. The snake eats the apple and grows
  4. Make the Snake Teleport
  5. Add score to the game
  6. Add Game over Screen

Snake Game Scratch Code

Snake Game Scratch Tutorial
Snake Game On Scratch

Make the Snake Controlled by Arrow Key

Make sure the snake moves continuously. Using Forever loop achieve constant movement. This is easy to code, when green flag clicked the snake will automatically move 20 steps.

The player uses the arrow keys to control the direction of the snake movement. As the snake is moving on its own, we can change the direction of the snake, by using ‘point in direction’ block from “Motion”.

Make Apple appear at random position

At a random spot, an apple is introduced into the game. This is easy to program. this need only 2 things.

Program your apple sprite so that, if snake touches it, it will hide and go to the random position and appear again.

The snake eats the apple and grows

Program your sprite so that, it should keep track of the points, and the snake must grow in size after eating.

This is perhaps the most complicated to understand.

You can build a clone or multiple clones in no time. The clone was continuously produced every 0.2 seconds. When it start as clone switch costume to body not the head.

Make sure switch the costume to the head at the beginning of the game to resolve the costume problem.

The snake eats an apple and raises its score by 1. yes. there ought to be a clone linked to the snake every time the player gets the point.

The waiting peiod before removing additional clones is same as Total clones multiplied by the speed. Or we can say Speed x score.

Make the Snake Teleport

Make the game more interesting, by letting the snake to teleport. i.e, Snake come from the opposite direction, when it hits the edge of the board. This will make the game more smoother.

Add score to the game

What happens if the snake eats apple?

Every time the snake eats a apple, the score increase by 1.

Add Game over Screen

Game will be over if it touches its own tail. When this happen we need to broadcast a game over message, so that other sprite can act accordingly.

Downlod Snake game On Scratch Project Files:

To download the project files of How to make Snake Game on Scratch Click here. Also go through the another interesting scratch 3.0 project of Frogger Game on Scratch here.

Leave a Comment