Skip to content

An implementation of the game Snake inspired by the classic Connect Four game.

Notifications You must be signed in to change notification settings

brahmlower/connect-snake

Repository files navigation

Connect Snake

An implementation of the game Snake inspired by the classic Connect Four game and this gif!

Background

This is the sourcecode for the connect snake game at blog.brahmlower.io/connect-snake-game. Controls are arrow keys, and Space will start/pause.

Using the library

You can install connect-snake via npm:

npm install git+https://github.com/brahmlower/connect-snake.git

The example directory shows the component usage, though there isn't much configuration available at this time. A good deal of energy was put into abstracting the display image from the game itself, so it should be pretty easy to implement other games like tetris or pong.

Development

  1. clone repo
  2. npm install
  3. profit?

Storybook

You may need to set the following:

export NODE_OPTIONS=--openssl-legacy-provider

Then start storybook:

npm run storybook

Running the Example

Build the package first, then install the dependencies in the example:

npm run build
npm pack
cd example
rm -rf node_modules
npm install
npm start

Bugs/Issues/Contributions

If you found a horrible bug or would like to improve this project in some way, feel free to open a pull request or Issue. If you have questions but are less comfortable posting in a public forum, feel free to email me!

About

An implementation of the game Snake inspired by the classic Connect Four game.

Resources

Stars

Watchers

Forks