1.2.1 • Published 2 years ago

react-life-game v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

👾 React life game

A React component that renders "Conway's Game of Life" 👾 .

You are a great God 👼 in this life game world, so you can control the life and death of cells by clicking on them.

lifegame

🌏 Installation

npm:

$ npm install react-life-game

yarn:

$ yarn add react-life-game

🚀 Usage

import { LifeGameField } from 'react-life-game';

function App() {
  return (
    <LifeGameField
      option={
        {
          /* option here */
        }
      }
    />
  );
}

👽 Playground

CodeSandBox

🛠️ option

optiontypedescriptiondefault
initialAliveRationumberRatio of living cells in the initial state (0,1)0.12
intervalnumberTime per each generation (ms)1000
aliveColorstringColor of living cells ( can be any color that "css" can accept. i.e. blue, #1e3a8a, ... )#1e3a8a
deadColorstringColor of dead cells ( can be any color that "css" can accept. i.e. blue, #1e3a8a, ... )#0f172b
cellSizenumberSize of cell (px)12
widthnumberWidth of the field of game of lifewindow.innerWidth
heightnumerHeight of the field of game of lifewindow.innerHeight
1.2.1

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago