1
\$\begingroup\$

I'm making a 2D game in Unity that's kind of like tangrams, a puzzle game where you form a specific shape (given only an outline or silhouette) by arranging smaller geometric pieces, which can not overlap.

I want to know how I could check to see if the 2+ shapes together make the target shape I'm trying to match. The shapes I'm putting together and the target shape I'm matching are two different things in the game, so it's not like I'm filling something in and can use a collider the traditional way. Does anyone have any insight?

\$\endgroup\$
3
  • 4
    \$\begingroup\$ For those that are not familiar with Tangrams, it would be really helpful if you could describe what exactly you are trying to do. \$\endgroup\$ Mar 18, 2019 at 17:21
  • 2
    \$\begingroup\$ How are your shapes represented in your game scene, and how are they placed/moved/transformed by the player? \$\endgroup\$
    – DMGregory
    Mar 18, 2019 at 17:43
  • 1
    \$\begingroup\$ What kind of solution do you need. Do you want ANY shape imaginable? You may have to do some physics / overlap code. Is there only 1 solution? Then you can hardcode the required positions, and if within a certain threshold of this solution, mark as correct. Can you restrict your shapes to fit on a triangular grid? You can define your solution as how the triangles are filled. \$\endgroup\$
    – gjh33
    Mar 19, 2019 at 17:09

0

You must log in to answer this question.

Browse other questions tagged .