Scratch Snake Tutorial

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Creating Snake Using MIT Scratch

Overview

This tutorial details the implementation of a version of the classic game Snake using MIT Scratch.

The tutorial is not a line-by-line walk-through of the code but rather an explanation of the concepts that are behind the game.

In this game the player controls a snake on screen. The object of the game is to guide the snake into eating as many apples as possible. Each apple makes your snake grow longer. The game ends if you crash into yourself.

Scratch Project

Click here to see the Scratch project!

Table of Contents

  1. Game Design
  2. Implementing the Game in Scratch
  3. Dividing the Playing Area into a Grid
  4. Snake with a Segmented Body
  5. Moving the Snake at Regular Intervals
  6. Using the Arrow Keys to Control the Snake
  7. Calculating the Snake’s Next Position
  8. Detect if the Snake Eats its Own Tail
  9. Moving the Apple
  10. Sound Playback
  11. Conclusion