In a simple match-3 game, with a square gems matrix creating and dropping new gems is fairly simple: when needed I generate those gems above the matrix and then I make them fall into the main matrix simulating that common fall-from-the-ceiling behavior.
Let's now imagine I have a matrix with some rock-type gems, the ones that will never move from their position, and I have cleared an entire column via a "powerful" gem. I have something like this:
OOO OOO OOO OOO OOO OOO OOO OOO OOX XOO OO OO O O OOOOOOO
O is a normal gem, and
X is a rock gem, that is fixed in the matrix and will not move from its original position.
When the new gems flow into this matrix, they will eventually move to the left or to the right to fill that big empty space, but each one will be dropped into the same column.
I'm wondering what the best way to drop those new gems is. I clearly cannot simply make them move from the top of the screen directly to their final position (as in the previous case), since the would move diagonally across the other gems (too bad).
I'd like to know what's the easiest and most flexible way to compute and the configure the path that each gem will have to follow.