The Snake

by yolabs007 in Circuits > Software

150 Views, 1 Favorites, 0 Comments

The Snake

The Snake

There are 100 of snake games but either they are not fun or too complex to make. Here i have created a very simple, yet cool looking and addictive sname game

Supplies

Scratch Account

Laptop

Internet

Create the Sprites

Black-Mamba-Snake-PNG-Photo.png
apple.png
restart.png
snake body.png
snake head.png
start.png

Difficulty - Easy

Time - 3 min


Except picture of the snake all sprites are created or used from scratch sprites library.


we will start wrtinig the code for all the above mentioned sprites. First we need to create the front page with

snake picture, title and start button

Start Page

Screenshot 2023-02-28 at 12.58.01 PM.png
Screenshot 2023-02-28 at 12.58.17 PM.png
Screenshot 2023-02-28 at 12.58.32 PM.png

This code will ensure that when game is started it will blink the start button and wait for start button to be clicked

Move the Snake

Screenshot 2023-02-28 at 1.04.56 PM.png
Screenshot 2023-02-28 at 1.05.03 PM.png
Screenshot 2023-02-28 at 1.05.08 PM.png
Screenshot 2023-02-28 at 1.05.16 PM.png

Eat the Apple

Screenshot 2023-02-28 at 1.10.23 PM.png
Screenshot 2023-02-28 at 1.10.30 PM.png

To eat the apple we will reply on three things

  1. Sprite changed from full apple to eaten apple
  2. Sound of Chomp
  3. Change of position
  4. increase the snake's tail length

Game Over and Restart

Screenshot 2023-02-28 at 1.12.50 PM.png
Screenshot 2023-02-28 at 1.13.04 PM.png

Game restart code is very similar to game start code.


Here is my full scratch project to have a look and to remix

https://scratch.mit.edu/projects/810521421