The Daily Click ::. Forums ::. Klik Coding Help ::. How to create a "puzzle"
 

Post Reply  Post Oekaki 
 

Posted By Message

Sergiocarp



Registered
  24/05/2009
Points
  294
21st October, 2009 at 18:20:49 -

Hi!

I want to create a "puzzle" game, and I wonder if anyone can help me with some examples ".Mfa" or something.

Image

[The idea is to drag and locating parts of the puzzle in its right place]


Thanks for your help! (sorry for my english ^^)

Edited by Sergiocarp

 
__________________________________

www.mmfzone.com (para miembros que hablen espaņol)*(for spanish members)

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st October, 2009 at 22:14:30 -

Kind of a vague question - you need to explain *exactly* how you want it to work.
It's actually *much* more complicated than it appears, btw. Potentially, it's an absolute nightmare infact.

For example:
* Is every piece a completely unique shape? (ie. only one piece can fit in a specific position)
* Are all pieces the same shape, and only differing in the picture on them? (as your picture shows)
* Are some pieces partially similar in shape? (ie. a piece may fit in some of the same positions as another piece, but not all)
* If the player knows two pieces go together, can he join them, even if he doesn't now where they go yet? (and can he then move them as a whole?)
* Where do all the pieces start out, before the player starts putting them together?
* Can pieces be rotated?

More generally, I'd suggest:

* use an array to store the correct positions of the pieces.
* make every piece the same size, and snap them to a grid when you stop dragging.
* use a combination of the overlay extension and active objects to prit a picture onto the pieces.

Like I said, I think it's an extremely difficult thing to do.
It would be *much* easier to make a game like this: http://mtbakerpuzzlebooks.com/images/puzzle_pieces.jpg

Edited by Sketchy

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st October, 2009 at 23:22:58 -

Here's a quick example of how to create an individual puzzle piece (as an active object) from a larger image:
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Puzzle.zip

There are much better ways to do drag and drop, so don't copy that part - search forums instead, as there are some good examples already. I'm just too lazy.

Obviously you need to repeat the process for each individual piece, and use different templates for the edges and corners. I'm not about to make your game for you though... (I'm sure you wouldn't even want me to).


EDIT: Sorry if anyone downloaded the old version and found it didn't work - I used appname$ instead of apppath$
It's fixed now.

Edited by Sketchy

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd October, 2009 at 16:51:05 -

Christ that sounds complex. My original thought would be a double dimensional array where you set the puzzle piece values to the exact X & Y spot that only they fit in, and then make checks to see if the player dragged and dropped that exact piece to the only spot on the array where it'd fit.

I think that'd be a big pain in the ass.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd October, 2009 at 16:52:06 -


Originally Posted by Sketchy.More generally, I'd suggest:

* use an array to store the correct positions of the pieces.



Yay, this is what I meant too if I had take 5 minutes to read first.

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click