km0 da8a756c50 | 3 years ago | |
---|---|---|
.vscode | 3 years ago | |
chaospuzzles | 3 years ago | |
.gitignore | 3 years ago | |
MANIFEST.in | 3 years ago | |
README.md | 3 years ago | |
setup.py | 3 years ago |
README.md
Prototype for a chaotic evil jigsaw puzzles system
This is a rough prototype for generating ready-to-print jigsaw puzzles as well as a way to track their completion in a shared platform. The idea is to have several puzzles and mix their pieces, in a way that invites the players to collaborate in order to solve them.
This prototype covers two aspects of the process: the first is to split an image into pieces, tracking every piece with an ID and store the relation between adjacent tiles. The second concerns the online platform, and it is a Flask application that permits to upload cluster of pieces in order to share them with the other players and unlocking the full puzzle.
To install the project:
- Clone the repo
- Create a virtual environment
$ python3 -m venv venv
- Activate the virtual environment
$ . venv/bin/activate
- Install the dependencies
$ pip install -e .
- Set the environmental variables for flask
$ export FLASK_APP=flaskr $ export FLASK_ENV=development $ flask run
- The Flask application will be accessible on your browser at
localhost:5000
. If you try to navigate there you will see a blank page. This is because we need to generate some puzzles to display.
Generating the contents
The first thing to do then is to run the split.py
script:
python3 chaospuzzles/split.py
This will take the Katamari demo picture from static/img
and will split it in tiles. The tiles will be used to compose the clusters when a player upload it online. In this way we can be super flexible in the randomization / distribuition of the pieces.
You can tweak the parameters at the end of the split.py file. This is temporary, later on it would be nice to have an interface to prepare the puzzle.
Completing the puzzles
If you reload the website, you will see a link pointing to the Katamari page. Here we will find an empty frame, and a form to insert new pieces.
Try it! You can find the IDs for the pieces in the chaospuzzles/puzzles/katamari/katamari_retro.png
image. This is the picture generated in order to be printed behind the puzzle and let every piece to have a unique ID.
By design an valid cluster is a group of adjacent pieces.
Keep in mind that this is a wip and rough prototype so everything need to be polished a lot. We count on your imagination to fill the lack of design, UI and UX here. Imagination is the best modern feature of 2022!
Thanks and see you sun ☀️