How do I create a Match 3 System like Bejeweled?

Hey everyone. First time here! I need a hand or guidance to create a match 3 system similar to games like Bejeweled and Candy Crush. I tried to find an answer before posting this.
I have made a rough concept as to what I have.

Since this is the first time I’m working on this, I have a hard time trying to figure out how to:

-Spawn new set of gems when the ones matches disappear.

-How to swipe gems that is highlighted.

-And to trigger an event if, say you have a minimum of three or more matching gems either horizontally or vertically.

Maybe there’s more to it, but I found the closest one that’s the baseline that’s exactly what I wanted. Match 3 Game | Play on gd.games

Yet I’m still confused as I couldn’t wrap my head around it how it works behind the scenes. I just needed the basic understanding or whatever, heck, even source file would be awesome. :slight_smile:

I have been using GDevelop for a good three years but I mostly made simple platformers and some oddball projects. I’m working on a new project for my friends and I’m stuck here. ^^;