I'm currently working on a Bubble Shooter-like and I manage to create a chain system to detect which gem of a colour is connected to another. It's not the best system but it's work, or more precisely : it's almost work. The player can shoot gems of 3 colours: Purple, Green and Yellow. My chain chain system works for the purple gems and the green gems but not for the yellow. They are detected but they're not deleted.
There is my capx.
Thanks in advance for the help.
My code works like this :
When a gem is snap with ohers i create six objects where the gem can connect with others. If those objects touch a gem, the gem will be mark and spawn others objects until there is no more gem to connect with. After that all the gem connected are detroyed.
This work for the Purple and the green but not for the yellow ones. The yellow ones are marked as picked but the function stop and don't mark them for being delete.
See my capture below for a more clear explanation.