Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 952 Bytes

short_snake.md

File metadata and controls

15 lines (11 loc) · 952 Bytes

Short Snake: rules

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

How do do this?

We have provided a detailed walkthrough of the steps needed to code up short snake using principles of object oriented programming. We recommend all but the most intrepid of coders follow the walkthrough!

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