/NoCanvasSnake

Inplementation of the game "Snake" in JS, without relying on Canvas

Primary LanguageJavaScriptMIT LicenseMIT

NoCanvasSnake

Inplementation of the game "Snake" in JS, without relying on Canvas

The ideia is to use HTML, CSS and JS, to make a functional Snake game. Only Mozzila' MDN documentation will be consulted (no other games or game algorithms).

For being considered functional the game must have the following features:

  • Map with well defined edges.
  • System of random spawning of fruit in the field that consider the position and size of the snake on the field.
  • Snake Player Character. It grows when eating fruits and dies if touch itself or the edges of the map.
  • Every fruit adds 1 "pixl" of length for the snake and give some points to the player
  • The body of the snake must follow the exctly same path as the head through out the intire field
  • The snake must walk in the direction it points until the player change the direction or it collides
  • Only moviments to left or right, from the perspective of the snake, is allowed.

Known issues:

  • Some times food spawns inside the snake's body
  • The snake stops moving if you keep arrow keys pressed
  • The game freezes a while when changing direction

Preview: https://sigma-guilhfer.github.io/NoCanvasSnake/