Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-26-2002, 03:58 AM   #1
kellie
Registered User
 
Join Date: Aug 2002
Location: new Zealand
Posts: 2
Question jigsaw puzzle game

I would like some help with jigsaw scripting.
I want the pieces to snap into place and then and merge into a smooth finished picture when it is done and then play a animation.
Please help I cant get the pieces to snap into place and then merge the puzzle has completed. Does anyone have some cool code for this
cheers kellie
kellie is offline   Reply With Quote
Old 08-26-2002, 09:24 AM   #2
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

for snaping u just make the hitTest() absolute, like
ActionScript Code:
onClipEvent(enterFrame){ if(this.hitTest(piece1._x,piece1._y,true){ this._x = piece1._x this._y = piece1._y } }
and if u r doing the drag thing on the mc, u could stop the drag then
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 08-26-2002, 10:35 PM   #3
kellie
Registered User
 
Join Date: Aug 2002
Location: new Zealand
Posts: 2
Default

thanks farafiro

Please be patient with me, in the code where you have
piece1 I am guessing that that is the instance name that you have given your piece and then for the x and y values does this mean that Each piece has a registration point that lines up with the dead centre of the stage?
k
kellie is offline   Reply With Quote
Old 08-27-2002, 07:25 AM   #4
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: EGYPT
Posts: 12,439
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

yes, u make all of your pieces movie clips. So the all have a registration pont (_x/_y).
Then, we also make our board into pieces as holders for the puzzles, and attach the code that I gave u to it
__________________
â€* GOD Is Near â€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-19-2007, 10:29 PM   #5
drumn4life0789
Registered User
 
Join Date: Feb 2007
Posts: 160
Default

I am doin a jigsaw puzzle as just a fun project to do.

I have made everything work the way i want except for two things.

I have a timer which I want to start when a certain button is pressed. Right now it starts cound as soon as you open the file, but only appears when you press the button.

Also the way i have my pieces set up is each actuall piece is piece#_mc, and it snaps into place when it has the same x/y coordinates as target#_mc.

I was wandering if anyone knew of how to make it where once all the pieces have attached to there target (puzzle is finished). it goes to another frame/scene.

thanx in advance
drumn4life0789 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.