Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 904 Bytes

growing_snake.md

File metadata and controls

16 lines (11 loc) · 904 Bytes

Growing snake: rules

  1. The snake begins as a single bone in the middle of the screen.
  2. The player selects a direction for the snake to move (up, down, left or right) using the arrow keys
  3. If the snake encounters food, it grows by one bone
  4. If the snake hits itself, it dies
  5. If the snake hits the side of the domain, it dies
  6. Food appears at the start of the game in a random location on the screen
  7. Each time a piece of food is eaten, another piece of food appears at a random location on the screen

How to do this?

Where we are going there are no roads (/walkthroughs). But, the Short Snake walkthrough provides a good base from which to build on.

A fully working version of the code is, however, provided here, and we recommend all coders execute this code (and play a few games) to get familiar with how the game works.