Scratch Tutorial on Snake Game
In this Tutorial, we attempt to make the popular snake game on Scratch
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.
Lets sketch out the snake game.
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”.
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.
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 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.
What happens if the snake eats apple?
Every time the snake eats a apple, the score increase by 1.
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.
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.
Here's a step-by-step tutorial to create a platformer game similar to Super Mario in Scratch:…
Here's a step-by-step tutorial to create a Whack-a-Mole game in Scratch with code snippets: 1.…
About Game: In Spot The Difference Game, the player has to spot the difference between…
In this scratch tutorial, you will create a memory game in which you have to…
In this article, we are going to teach you how to program your owncustomized version…
About Duck Hunt Game: This is a remake of the classic video game Duck Hunt.…
This website uses cookies.
View Comments
Wow that was strange. I just wrote an incredibly long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say great blog!
I'm extremely impressed with your writing skills as well as with the layout on your
blog. Is this a paid theme or did you customize it
yourself? Anyway keep up the nice quality writing, it is rare to see a great blog like this one today.