A friend asked me to make a small demo of a game where blocks are lined up in a grid formation. And by clikcing on the blocks in the grid, they disappear. When a block is destroyed, the blocks above it need to fall and fill in the space the destroyed block left behind.
Initially, I thought to just simply use vector movement or manually set the movement and stop the movement when a collision with another block is detected. Unfortunately, this doesn't seem to be working. The blocks tend to detect that they are sitting exactly next to another block, so they don't move at all.
Can anyone offer a clean solution for making the blocks slide down if a gap appears below them? I thought about making a detector, but since these blocks are all duplicates, the detector only seems to work on one block (the last one created).
Thanks in advance,
Mobichan