Skip to content

kofosu2289/snayke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snayke.js

License: MIT snaykejs on NPM

Run on Repl.it

A terminal-based Snake implementation written in Javascript

snayke.gif

Instructions

Use the arrow keys (, , , ) or W A S D to navigate the snake up, down, left, or right. Eat the red dot to gain points. If the snake collides with the wall or its own tail, it's game over. Press ENTER to restart, and Q, ESCAPE or CTRL + C to quit the game.

Installation

Run without installing

The easiest way to play the game is to just run it in the terminal without installing anything!

npx kofosu2289/snayke

Clone from repository

git clone https://github.com/kofosu2289/snayke.git
cd snayke

# install and run via npm or yarn
npm install && npm run play
yarn && yarn play

npm module

Add the snaykejs module

npm install snaykejs
yarn add snaykejs

Create the game.

// index.js

const blessed = require('blessed')
const { UserInterface, Game } = require('snaykejs')
const ui = new UserInterface(blessed, blessed.screen())
const game = new Game(ui)

// Begin game
game.start() 

Run the game.

node index.js

Author

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published