This content has been marked as final. Show 5 replies
you can use the following function to randomize your array of [x,y] arrays:
Thanks for that kglad. However, my problem is in the fact that before I can shuffle the elements I need to actually create a two dimensional array to store the references. Maybe if I outline the sequence I need to access it may help...
1. Define the array so it can take x and y locations for each of the 48 pieces of the jigsaw
2. Create the original x,y refs for the pieces. They are 100*100 pixels each.
3. Randomise these locations to mix up the pieces into each of the 48 (8 columns by 6 rows) cells on the jigsaw.
I'm fairly new to this 'flash' programming having done all my work so far in Visual Basic. It's difficult to break old habits!
Any advice will be gratefully received.
the array posA will contain all your grid points. shuffle posA and then assign the ith puzzle piece to have x,y properties of posA[ i ],posA[ i ].
Looks good - many thanks kglad.
Got to go out for a while now... will try it when I get back.