0.2.0 • Published 4 years ago
jigsaw-canvas v0.2.0
jigsaw-canvas
A jigsaw puzzle generator for HTMLCanvas
This library is still unstable.
API
generatePuzzle(image, rows, columns) returns an array of rowsXcolumns puzzle pieces based off image.
Demo
Multiplayer Demo (Local Build)
Install
yarn install
Start client server
- Make sure you're at the
jigsaw-canvasroot directory npx live-server --host=localhost- Navigate to
localhost:<port>/multiplayer-demo/clientin the browser.<port>is whatever thelive-serveris running on, e.g8080
Start backend server
cd multiplayer-demo/servernpx nodemon server.js
Open another browser with the same url and you should see real time sync when moving pieces.