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.
* 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.
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.
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!