Last night, I worked on a capx from 7:00PM to 3:00 AM and didn't get what I wanted.
I need to create Match3 mechanics for my game.
I began with creating an array (6,6,1) where the values are Int(Random(4)).
Then, for each XY, I create an instance of "Gem" (sprite with 4 animations, each being a color). The color is decided by the Int(Random(4)) value (0=Blue, 1=Yellow, 2=Red, 3=Green).
So, I got a 6x6 board of gems.
But I need to know if 3 or more cells of the same color are touching.
So I created an instance var for "gem" that stores the animation name (color), a Global variable called "PreviousColor" and another called "clickCount".
If clickCount = 0, create a "selection" object over the clicked Gem, store the Gem color in the PreviousColor global var, set clickCount to 1.
If clickCount =/= 0, check if PreviousColor = Gemme.Color
The rest of the code is gibberish: newbie attempts to check when same color if both gems are connected, and that doesn't work.