One more. We’re not making just this puzzle, right? You’re going to have many different puzzles for the player to assemble, surely.
- more blocks?
- more complex shapes?
- fall order is always fixed?
- if I place the blue block upside down, it’s still a valid solution?
I can think of half a dozen ways to detect it but there simply is not enough info here to suggest a method since we know so little. How you put this puzzle together would also dictate the way to script the detection mechanism.
Without knowing all the details, the most agnostic approach could be a generic combination of tracing & tags.
- a puzzle piece is made of many blocks (I assume, again)
- each block is an extended SMC
- a block has a correct orientation (more than one is OK), set at design time per puzzle
- a block has a tag and is looking for another tag (or use enumeration), set at design time per puzzle
- when blocks stops moving,
For Each Loop with Break
(blocks inside the puzzle piece) trace in the direction of correct orientation, query a tag of the hit component - if distance is small and a matching tag has been found, the block placement is correct, then keep checking other blocks
- else, it’s fail, break the loop
Considering the above, the red piece could be set like so to work in this puzzle:
And then build the actor puzzle pieces out of those blocks:
Sounds (to me) as if could work fine.
-famous last words!