Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "snekjs", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A terminal-based Snake implementation written in JavaScript (Node.js) 🐍", | ||
@@ -17,3 +17,9 @@ "author": { | ||
}, | ||
"licence": "MIT", | ||
"keywords": [ | ||
"snake", | ||
"javascript", | ||
"node" | ||
], | ||
"private": false | ||
} |
@@ -9,2 +9,6 @@ # 🐍 Snek.js [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![snekjs on NPM](https://img.shields.io/npm/v/snekjs.svg?color=green&label=snekjs)](https://www.npmjs.com/package/snekjs) | ||
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 | ||
### Clone from repository | ||
@@ -11,0 +15,0 @@ |
@@ -115,3 +115,3 @@ const { | ||
this.snake.forEach(segment => { | ||
if (segment.x === this.x && segment.y === this.y) { | ||
if (segment.x === this.dot.x && segment.y === this.dot.y) { | ||
this.generateDot() | ||
@@ -118,0 +118,0 @@ } |
55876
62