I am making a EggShooter like BubbleShooter.
If the player hit a egg, the program have to collect all eggs around with the same color.
after using this function all the eggs with property net = 1 can be removed.
In code I do it this way, and I wonder how to do this in Construct 2
function BuildNetByColor(xx, yy, color)
{
For Each(egg in Eggs)
{
if (egg.net == 0)
{
if (egg.visible)
{
if (egg.AnimationFrame == color)
{
if (egg.distance_to_point(xx,yy) < 40)
{
egg.net = 1;
BuildNetByColor(x, y, col);//recursion
}
}
}
}
}
}