Snake game made using vanilla JavaScript and HTML
Try it here: https://litlatte.github.io/snake-js/
- JavaScript
- HTML
To import the game into your website you have add five important elements into the HTML:
- A canvas that will contain the game
- A text element that will contain the number of current points
- A text element that will contain the number of record points
- The 'Game.js' script file
- A script that initiailize the 'Game' instance To see a working example check the index.html and main.js of this repo
Its also optional to add an empty div for html buttons that control the snake