I made this several days ago but was hoping you would try to work through the example yourself so you can figure out what's going on, and ask specific questions about where your attempts failed so we can help you understand the logic and make you a bit more independent <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">.
Since that hasn't happened, here's the cap (only done for the red blocks), hopefully that's enough to get you going enough to be able to make any other modifications on your own.
Any 3 or more red blocks that touch together in any sort of formation (they don't all have to touch each other, just be part of a connected group) are destroyed, and a new red block forms at a location of their average X and average Y
https://dl.dropboxusercontent.com/u/308 ... merge.capx