Coding - part C
Now we are going to create the button Shuffle and give it the conditions to shuffle the puzzle pieces.
1) Drag away the " away piece".
2) Rearrange the pieces as if playing. Leave the corner that you chose for the "away piece" empty after rearrangement.
3) Once the pieces are all in different positions you need to create transition points A, B, C, ... depending on how many loops you will have in your arrangement.
4) Sketch the replacement positions of each piece. Example:
A ---> P5 ---> P1 ---> A (first loop)
B ---> P4 ---> P2 ---> P3 ---> P6 ---> P7 ---> P8 ---> B (second loop)
5) Create the button Shuffle using GGB tools.
6) Select button and go to settings ---> scripting ---> on click
7) Type the code accordingly to your puzzle arrangement. Example:
8) Bring the "away" point to the correct position.