|
Hi,
First off, thanks in advance, of course. I couldn't find this on the forum in my search, so hopefully I didn't miss because of wording or something. If I did, I'm sorry.
I'm working on a puzzle game similar to puyo puyo in style, and I'm trying to figure out a way to register the groups of blocks efficiently. Basically, I've got all the spaces on the board in a matrix, and the numbers 1-4 signifying which color block is in that space, with 0 signifying an empty space (simple, right?) Now, when 4 or more blocks of the same color are touching in any configuration (line, L-shape, square, whatever), they should break and the ones above them should fall. Unfortunately, I've been embarassingly stumped on how to work this out in a feasible and mathematically simple way.
I'm working in LOVE, a lua based engine, with a friend of mine, for simplicity's sake, but I have some limited experiences in other languages, and this is pretty much just a math-based problem, so hopefully the engine won't be too much of a problem.
Thanks again.
|