@dip-in-milk/snake

Snake game engine

Usage no npm install needed!

<script type="module">
  import dipInMilkSnake from 'https://cdn.skypack.dev/@dip-in-milk/snake';
</script>

README

Snake Game Engine

NPM version Build Status Coverage Status GitHub issues GitHub stars Slack

Install

npm install --save @dip-in-milk/snake

API

import Snake from '@dip-in-milk/snake';

// create a new Game with width and height
const game = new Game(20, 20);

// create a new Player
const player1 = new Player(game);

// add a fruit
game.gameObjects.push(new Fruit());

// start ticking :)
setInterval(() => game.tick(), 100);