Snake

Dependencies:   microbit

Fork of microbit_snake by Mohammad Khan

A Snake Game with animation, score and continuous play

Steps:

  • Switch On.
  • Snake animation plays.
  • Game starts.
  • Press buttons to move the snake left, right, up and down.
  • Food appears as a dot on the display.
  • Try eating the food by manoeuvring Snake to run over it.
  • Snake grows as it eats food.
  • As it grows it becomes hard to avoid snake biting itself.
  • Game Over.
  • Snake is flashed and then score is scrolled.
  • Game restarts after replaying animation.

Controls:

  • Left Button (A)
    • If snake moving UP/DOWN moves snake to LEFT.
    • If snake moving LEFT moves snake to DOWN.
    • If snake moving RIGHT moves snake to UP.
  • Right Button (B)
    • If snake moving UP/DOWN moves snake to RIGHT.
    • If snake moving LEFT moves snake to UP.
    • If snake moving RIGHT moves snake to DOWN.

How it looks:

https://www.youtube.com/watch?v=unEs3NOvIKA

Binary to play with

/media/uploads/mazimkhan/microbit_snake_nrf51_microbit.hex

Committer:
mazimkhan
Date:
Wed Apr 13 15:03:44 2016 +0000
Revision:
5:9328487a0a46
Parent:
1:6cfdf4a39678
Changed random max to 5 to allow value between 0-4 for x,y coordinates. Otherwise we are stuck in an endless loop trying find good snake food!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mazimkhan 0:af1bb8b895c7 1 syntax: regexp
mazimkhan 0:af1bb8b895c7 2 \.hgignore$
mazimkhan 0:af1bb8b895c7 3 \.git$
mazimkhan 0:af1bb8b895c7 4 \.svn$
mazimkhan 0:af1bb8b895c7 5 \.orig$
mazimkhan 0:af1bb8b895c7 6 \.msub$
mazimkhan 0:af1bb8b895c7 7 \.meta$
mazimkhan 0:af1bb8b895c7 8 \.ctags
mazimkhan 0:af1bb8b895c7 9 \.uvproj$
mazimkhan 0:af1bb8b895c7 10 \.uvopt$
mazimkhan 0:af1bb8b895c7 11 \.project$
mazimkhan 0:af1bb8b895c7 12 \.cproject$
mazimkhan 0:af1bb8b895c7 13 \.launch$
mazimkhan 0:af1bb8b895c7 14 \.project$
mazimkhan 0:af1bb8b895c7 15 \.cproject$
mazimkhan 0:af1bb8b895c7 16 \.launch$
mazimkhan 0:af1bb8b895c7 17 Makefile$
mazimkhan 0:af1bb8b895c7 18 \.ewp$
mazimkhan 1:6cfdf4a39678 19 \.eww$