RE: [Flashcoders] puzzle: how to verify piece-fitting?
I suspect you could use bitmap data to achieve something along these lines - if each piece has a special pixel - you can use that pixel to check against a master bitmap to see if it's in the right place, combined with snapping it should make it quite easy. - if you know it's in the right place and one of it's neighbours has also been placed then you can make this a 'combined piece'. Something along those lines anyhow. M > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of lars > Sent: 10 March 2006 23:43 > To: Flashcoders mailing list > Subject: Re: [Flashcoders] puzzle: how to verify piece-fitting? > > yeah, kind of. one thing makes it easy that is that all > pieces can only be placed in a pre-defined area (a shape > showing the outline of the puzzle), but i'm still looking for > some kind of algorythm that makes the already fitted pieces > drag/drop together... like having a,b,c mixed up, all single > drag/drop-able, but when c fits to a they both "join" and get > drag/drop- able as one "piece". that's the problem i now > have. any solutions welcome. > thanks: lars ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] puzzle: how to verify piece-fitting?
yeah, kind of. one thing makes it easy that is that all pieces can only be placed in a pre-defined area (a shape showing the outline of the puzzle), but i'm still looking for some kind of algorythm that makes the already fitted pieces drag/drop together... like having a,b,c mixed up, all single drag/drop-able, but when c fits to a they both "join" and get drag/drop- able as one "piece". that's the problem i now have. any solutions welcome. thanks: lars Am 10.03.2006 20:23 Uhr schrieb "Fitzpatrick, Kevin" unter <[EMAIL PROTECTED]>: > I can't off the top of my head think of any visual ways of doing it, but > you can check the relationship of the pieces to each other. For > instance if piece A can only fit to the left of B and the bottom of C > (it's the lower left hand corner) then you could check those two > distance relationships and the rotation of each. > > You'd have to store all of the "right" relationships somewhere, such as > in the piece instances. > > Is this the kind of solution you're looking for? > > > Kevin Fitzpatrick > Flash Designer, > SAP.com Web Services Team - SAP Global Marketing > SAP Global Solutions Center > 3999 West Chester Pike > Newtown Square, PA 19073 > C (267) 254-6225 > E [EMAIL PROTECTED] > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of lars > Sent: Friday, March 10, 2006 8:04 AM > To: Flashcoders mailing list > Subject: [Flashcoders] puzzle: how to verify piece-fitting? > > hi all. i'm looking for some example on puzzle games which "detect" > (show the user) that the pieces are arranged correct. those i know > are "simple" drag and drop together ones with do not detect that the > pieces are arranged correct and fit. any examples or ideas on how > to "detect" that (when having different puzzle piece forms)? thanks: > lars > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] puzzle: how to verify piece-fitting?
I can't off the top of my head think of any visual ways of doing it, but you can check the relationship of the pieces to each other. For instance if piece A can only fit to the left of B and the bottom of C (it's the lower left hand corner) then you could check those two distance relationships and the rotation of each. You'd have to store all of the "right" relationships somewhere, such as in the piece instances. Is this the kind of solution you're looking for? Kevin Fitzpatrick Flash Designer, SAP.com Web Services Team - SAP Global Marketing SAP Global Solutions Center 3999 West Chester Pike Newtown Square, PA 19073 C (267) 254-6225 E [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of lars Sent: Friday, March 10, 2006 8:04 AM To: Flashcoders mailing list Subject: [Flashcoders] puzzle: how to verify piece-fitting? hi all. i'm looking for some example on puzzle games which "detect" (show the user) that the pieces are arranged correct. those i know are "simple" drag and drop together ones with do not detect that the pieces are arranged correct and fit. any examples or ideas on how to "detect" that (when having different puzzle piece forms)? thanks: lars ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] puzzle: how to verify piece-fitting?
sounds not that hard, nevertheless any examples would be great A very nice Shocwave 3d example I've always liked is here: http://www.madfishstudios.com/puzzle/libraryTest1.htm Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] puzzle: how to verify piece-fitting?
sounds not that hard, nevertheless any examples would be great Am 10.03.2006 14:18 Uhr schrieb "Danny Kodicek" unter <[EMAIL PROTECTED]>: > >> hi all. i'm looking for some example on puzzle games which "detect" >> (show the user) that the pieces are arranged correct. those i know >> are "simple" drag and drop together ones with do not detect that the >> pieces are arranged correct and fit. any examples or ideas on how >> to "detect" that (when having different puzzle piece forms)? thanks: >> lars > > There are various levels of this. One (generally for the simplest puzzles > for small children) locks the pieces to their exact space on the board. > That's pretty easy to do: assuming you know where each piece belongs, when > the mouse is released you simply calculate its distance from the target > position and lock if it's below a certain threshold. > > The next level is where you link pieces to each other rather than to the > board. Actually, this isn't much harder to do: you store the pieces' correct > x and y positions, then when a piece is dropped, you look for the relative > positions of its neighbours, and check how close they are to correct (eg: > you know that the right-neighbour must be at a relative position of (w,0), > so if it's currently at (w+1,2) you decide that's close enough and lock it > in place. > > The next level, for an irregular grid, is to store for each piece a list of > the neighbours it can link to, and continue as the previous example. > > Finally, you can allow rotation of pieces. This is exactly the same as > before, but you also have to check that the pieces are at the correct > relative orientation (in particular, it affects the calculation of the > 'relative position' of the neighbour pieces. > > Clear? I can give you some code, but an explanation is generally more > useful... > > Danny > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] puzzle: how to verify piece-fitting?
hi all. i'm looking for some example on puzzle games which "detect" (show the user) that the pieces are arranged correct. those i know are "simple" drag and drop together ones with do not detect that the pieces are arranged correct and fit. any examples or ideas on how to "detect" that (when having different puzzle piece forms)? thanks: lars There are various levels of this. One (generally for the simplest puzzles for small children) locks the pieces to their exact space on the board. That's pretty easy to do: assuming you know where each piece belongs, when the mouse is released you simply calculate its distance from the target position and lock if it's below a certain threshold. The next level is where you link pieces to each other rather than to the board. Actually, this isn't much harder to do: you store the pieces' correct x and y positions, then when a piece is dropped, you look for the relative positions of its neighbours, and check how close they are to correct (eg: you know that the right-neighbour must be at a relative position of (w,0), so if it's currently at (w+1,2) you decide that's close enough and lock it in place. The next level, for an irregular grid, is to store for each piece a list of the neighbours it can link to, and continue as the previous example. Finally, you can allow rotation of pieces. This is exactly the same as before, but you also have to check that the pieces are at the correct relative orientation (in particular, it affects the calculation of the 'relative position' of the neighbour pieces. Clear? I can give you some code, but an explanation is generally more useful... Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com