- Home /
Design/discussion question
Creating Jigsaw Puzzle using UnityScript
Ahoy mates!
I'm an indie game designer. Myself with 4 other guys are making an action puzzle platformer game for mobile devices called "Biopower". This is our first commercial game. You can check out a couple of screenshots here.
The game is coming out pretty amazing with fantastic gameplay, art & music. But we've a problem. We've a piece of jigsaw puzzle as a collectible at every level. Once the player completes all the levels, a new scene will open where the player has to solve the jigsaw puzzle. Our lead programmer is clueless on how to make this jigsaw puzzle work.
Should we use 2D GUI/Sprite? Or Should we use 3D mesh?
Each piece should be select-able, drag-gable and rotatable(with UI keys)... Once they're placed in their correct positions, the pieces shouldn't be select-able, drag-gable or rotatable any more.
Can anybody help us with a basic script for this kind of jigsaw puzzle? We tried searching in many forums but we couldn't find any appropriate answers. We can't afford to buy any Jigsaw Puzzle Pack right now.
Any help would be appreciated... Thank you very much...
make a 2d array with codes in each cell, then when the player moves a piece and rotates it to the correct part it corresponds with the code in the 2d array, when the code generated by the piece matches the 2d array lock it out. logic is fairly straightforward for that
(anyone know why this question is in pink and I cannot answer it?)
@bubzy - this question is likely pink because two moderators acting on it at approximately the same time...one to publish and one to reject.
As this question stands now it is not a good fit for Unity Answers. Unity Answers addresses a single, specific technical question. Design/discussion questions should be asked on Unity Forums.
While there are many approaches, in general there is a consistent set of problems to be solved.
Given a reference to a single puzzle piece, there needs to be a way to find the neighboring pieces in the solved puzzle.
Given references to neighbors, there needs to be a way to figure out the offset from the 'selected' piece to the neighbors in the solved puzzle.
When to disconnected pieces or clusters are correctly combined, there needs to be a way for 1) the code to identify the condition, and 2) lock the two together to form a new cluster.
Draging on any puzzle piece in a solved cluster should move all the pieces in the cluster.
There needs to be a way to identify when all the pieces are in a single cluster (puzzle solved).
$$anonymous$$any of these issues have been addressed in other Unity Answers questions.
If you do post on Unity Forums, consider editing this question and providing a link. That way anyone from this list who wants to comment or follow the discussion can find the question on the Forums.
The pink is so pretty! We should do all our questions like this.
Thank you very much for your answers. This is my first time asking a question on Unity Answers, so I didn't know about the eligible questions. I'll try asking this in forum.
Answer by YoungDeveloper · Oct 23, 2014 at 08:16 PM
Our lead programmer is clueless on how to make this jigsaw puzzle work.
Then he is a coder, not a programmer.
Should we use 2D GUI/Sprite? Or Should we use 3D mesh?
Really depends on the type of puzzle you want to implement.
Each piece should be select-able, drag-gable and rotatable
There is no such thing as built in selectable or dragable, you will have to write it yourself from scratch. That can be done using almost basic knowledge over OnGui(). But as i said, its hard to comment without knowing actual puzzle idea.
Thanks for the reply mate. The programmer is new to unity. So, he doesn't have much idea about using GUIs. I code some basic stuff but I'm not a programmer or coder.
Yeah, I figured out there's no built in selectable, draggable or rotatable thing but we don't know how to code them. The puzzle is 4x4(16 pieces) puzzle like in Braid.
Since the question is closed, & are not allowed to answer further, I'll post my email id here: mozymervin@gmail.com
Follow this Question
Related Questions
Pulling Puzzler 2 Answers
Need help with "Tetris" or "Match 3" puzzle logic 1 Answer
How to use sections of a texture? 1 Answer
Any idea on how to make objects be clicked in a certain order? (C#) 1 Answer
How do I pick up an object and place it in a spot that kind of like a missing puzzle piece? 0 Answers