A simple terminal snake game library with no external dependencies
npm install by-sensorsbash
Install globally
npm install -g terminal-snake-game
Or install locally
npm install terminal-snake-game
`
Usage
$3
After installing globally, you can start the game directly:
`bash
snake-game
`
$3
You can use it in your code:
`javascript
const { startGame } = require('terminal-snake-game');
// Start the game
startGame({
width: 20, // Game area width
height: 10, // Game area height
speed: 200 // Game speed (milliseconds)
});
``