🐍 Snek.js
![snekjs on NPM](https://img.shields.io/npm/v/snekjs.svg?color=green&label=snekjs)
A terminal-based Snake implementation written in JavaScript (Node.js).
![snek.gif](https://raw.githubusercontent.com/taniarascia/snek/master/snek.gif)
Instructions
Clone from repository
git clone https://github.com/taniarascia/snek
cd snek
yarn && yarn play
npm module
Add the snekjs
module.
yarn add snekjs
Create the game.
const blessed = require('blessed')
const { UserInterface, Game } = require('snekjs')
const ui = new UserInterface(blessed, blessed.screen())
const game = new Game(ui)
game.start()
Run the game.
node index.js
Acknowledgements
- Vanya Sergeev for pointing out my snake collision bug, for advising me to make a single, reusable draw method, for showing me how to properly bind methods between classes, and for overall guidance and inspiration
- Devin McIntyre for general advice
- Panayiotis Nicolaou's JavaScript Snake for Web for initial logic
Author
License
This project is open source and available under the MIT License.