0.1.0 • Published 4 years ago

@poekimonster/snake v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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}>
    )
}