headbreaker icon indicating copy to clipboard operation
headbreaker copied to clipboard

Slightly different puzzle piece sizes/shapes/connections

Open MartinTale opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. In real world jigsaw puzzles each piece is slightly different so just by (shape/size/connections position and size) you can tell if piece will fit with another one.

Describe the solution you'd like Differentiate each piece slightly.

Additional context example

MartinTale avatar May 13 '23 07:05 MartinTale

:wave: Hi @MartinTale!

That would be a nice feature. It is quite tricky, though, since designing such irregular but still matching connection - and making them look good :sparkles: - is a complex task. That is why headbreaker puzzles don't try to mimic realistic features, but instead focus on providing flexible building blocks for implementing jigsaw-like data structures and games.

That said, implementing your own pieces outlines is provided out-of-the-box. Just pass your own outline object - which should be capable of providing straight or Bezier points for a given piece - when you create your canvas. See https://github.com/flbulgarelli/headbreaker/discussions/55 for more details.

Since you can attach your own metadata to your pieces, you should be also able to control how each individual piece is rendered.

That said, feel free to provide a more detailed specification of how that edges should be drawn, or even an implementation of a working outline, and I would happily integrate it to the core :muscle: .

Hope that helps!

flbulgarelli avatar May 16 '23 22:05 flbulgarelli