@poekimonster/snake

0.1.0 • Public • Published

Snake

A simple snake game which I've made to learn React.

Installation

To use the snake game in your React App:

npm install @poekimonster/snake

Usage

In a React app:

import React, { useState } from 'react';
import { SnakeGame } from '@poekimonster/snake';

const myGame = () => {
    // Define a state for the highscore and pass it to the SnakeGame.
    const [highScore, setHighScore] = useState(0);

    return (
        <SnakeGame highScore={highScore} setHighScore={setHighScore}>
    )
}

Readme

Keywords

Package Sidebar

Install

npm i @poekimonster/snake

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

3.27 kB

Total Files

4

Last publish

Collaborators

  • poekimonster