pureboard
v2.2.0
Published
A library for creating multiplayer boardgames
Maintainers
Readme
pureboard
A library for creating multiplayer boardgames
Pitch
Do you want to implement multiplayer turn based game, but replication and visualization is a headache? Worry not, just:
- Implement game as pure functions mutating a state
- Create a React (or React Fiber if you want 3D) component to display that
- Let
pureboardhandle the rest - game is now playable online
Install
npm install pureboardOverview
pureboard is a library that allows for easy implementation of multiplayer games, by replicating actions on a state. It's designed for boardgame-like games, but can be used for other projects. It uses zustand for state management, so replicated state on client can be easily used in a React project.
How it works?
Players are sending actions that can mutate server game state.
First, server tries to apply the action on it's state, and if it's valid, it get's send to all players.
Example
See example directory for example of a online multiplayer connect4 game.
- Run
npm installin root directory - Run
npm installin theexampledirectory - Run
npm run devin theexampledirectory - Open http://localhost:3000 in your browser
