For something like that, you actually need 9 Matrixes, positioned like this:
123
456
789
The player will always be on the middle matrix. So they start on 5, and when they go on 2, 789 move up and in front like this:
789
123
456
If they then move onto matrix 9, then the tiles must move up and right.
564
897
231
You also need to make the matrix's seamless, this is done by changing the height of each point around the matrix to equal the one next to it. This may be confusing but with variables to hold each position of the matrix then it's quite easy. I.e. There's a variable for the POSITION of the 9 matrixes.
"Computers are useless they can only give you answers."