Not a working game, just showing @spyrofan how using a grid system and a list makes this easier to handle. I got rid of nearly 90 variables and over 200 scripts - not to mention 36 sprites! Obviously more work is required and this may currently do less than the original but probably not much less. This will create a random grid of jewels and then mark the first line it finds with 3 or more in a row with a red line. It will also mark all rows of 3 or more with a yellow line.
just helping on the forum