https://github.com/thecodeholic/jspicturepuzzle
Javascript Picture Puzzle game
https://github.com/thecodeholic/jspicturepuzzle
Last synced: 3 months ago
JSON representation
Javascript Picture Puzzle game
- Host: GitHub
- URL: https://github.com/thecodeholic/jspicturepuzzle
- Owner: thecodeholic
- Created: 2019-01-14T08:06:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T10:13:27.000Z (over 6 years ago)
- Last Synced: 2025-03-21T22:41:30.551Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 135 KB
- Stars: 15
- Watchers: 5
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Javascript Picture Puzzle game
## Setup
1. Clone the project
1. Go to the project root directory
1. Run `npm install`## Launching demo
Run `npm run start:dev` to start the webpack dev server for demostration of the game
### or
Run `npm run build-demo` to build the demo in `dist` folder
## Usaging in your website/app/project
Run `npm run build` which will create `PicturePuzzle.js` file in `dist` folder.
Create an PicturePuzzle class instance in your javascript file
```javascript
const puzzle = new PicturePuzzle(htmlDomElement, imageSourceUrl, canvasWidth, dimmension = 3);// To listen to an event when game is finished
puzzle.onFinished = function(){
// Show finish dialog
};
```