I don't know what the best possible solution is, but I can tell you what I would do if I were making this type of game.
I would have an array called ColumnCounter where each index corresponds to a column. Index 0 would refer to column 0, index 1 would refer to column 1, etc. So its size would be how many columns you have in your game. The value held at each index would simply be a counter which increases by 1 every time a block in that column is spawned.
Each block would have a variable called ID or something similar. It would be assigned the value at its column index in the array. After it is assigned, the value at the index would increase by 1. Each block would also have a variable called Column, and when a block is spawned, this variable would assigned the value of what column the block is spawned in. So if it spawned in column 5, its Column variable would be 5.
When a block is destroyed, an event would perform a For Each search for Blocks. The next condition would be blocks whose Column variable matches that of the block that was destroyed. And the last condition would be blocks whose ID is less than the ID of the block that was destroyed. Each block should also have a variable perhaps called Detached or Free, or anything that helps you know that this block should fall. In the action part of this event, set your Detached variable to True. (You can make this variable a boolean. I don't use booleans though, I make two global variables, True = 1, and False = 0. I would make Detached a Number variable and type True and False. I do this to use booleans in equations.)
In your event which advances the blocks, you would apply an additional Y movement to all blocks whose Detached variable is True. You may also want another variable which would prevent the detached blocks from being destroyed by a block that you launch.
Wow, okay this post is long! I will step through this with an example to show you how it would work. I will make a variable called RandomColumn for randomly spawning a block. I will also make two variables called DestroyedBlockColumn and DestroyedBlockID
- Block is spawned in column RandomColumn
- Its Column variable is set to RandomColumn
- It's ID is set to ColumnCounter.At(RandomColumn)
- ColumnCounter.At(RandomColumn) = ColumnCounter.At(RandomColumn) + 1
When a block is destroyed:
- DestroyedBlockColumn = Block.Column
- DestroyedBlockID = Block.ID
- For Each Block, where Block.Column = DestroyedBlockColumn, and Block.ID < DestroyedBlockID
- Set Block.Detached = True
In your event which advances the blocks:
- Block.Y = Block.Y + (whatever you have the normal blocks doing) + (Block.Detached * dt * (another number, perhaps a percentage of the game window height, you will have to experiment))
- this part works if Detached is a Number variable
I hope this helps, ask me any questions you may have.