I'm making a game with elements of a match-3 puzzler (such as Columns, Bejeweled or Tetris Attack). I don't know where to begin creating an efficient algorithm for matching and clearing.
- Blocks of a like color can be matched horizontally, vertically, or diagonally in sets of at least 3.
- Blocks are held within a grid. They do not move horizontally.
- However, blocks do move vertically due to gravity.
- This is an action game, therefore we have to check up on the grid each frame.
- Due to the design of my game, however, we only need to check for matches if at least one block was falling in the previous frame.
Where do I go from here?