I'm trying to figure out how a match 3/"bejeweled" game works. I have 25 black squares that act as squares on the game grid that spawn one of 3 random colored squares. If a square is touching another square of the same color, it is is suppose to add a point of which when equals 3 or greater would then be destroyed giving the player points. I have no actual gameplay done as I am first trying to make the grid layout start with 25 random squares to start with. My problem is that I cannot figure out:
1. How to prevent sets of 3 or more vertical/horizontal from generating at the start of the layout.
2. How to make all squares associated with the 3 or more pair be destroyed once in the pair.
I am including my .capx file as well as a screeenshot of my events
drive.google.com/file/d/1dBMcFClfj7bHHmk_3812z0i5becWXLSz/view
Thank you.