It does pick all, but like you said it passes only single value to function as it is just single variable. Put for each sprite loop at the condition where you call the function. This will call the function for each picked sprite.
Thank you, I feared it would have to resort to something like that.
When an event picks more than one instance of an object, don't the actions work like a foreach loop themselves?
For instance, say there's a game where there are balls, and some of them are spiky, and you want to move all of the spiky balls one pixel to the right.
Construct 2 logic:
Event: Ball -> Is isSpikey
Action: Ball -> Set X to self.X + 1
loose programming translation:
foreach (Ball ball in listOfBalls)
if (ball.isSpiky)
ball.X += 1;
----------
Doing this with functions:
Construct 2 logic:
Event: Ball -> Is isSpikey
Action: Function -> Call "MoveOnePixelRight" (Ball.UID)
Event: Function -> On "MoveOnePixelRight"
Sub-Event: Ball -> Pick instance UID Function.Param(0)
Action: Ball -> Set X to self.X + 1
loose programming translation:
foreach (Ball ball in listOfBalls)
if (ball.isSpiky)
MoveOnePixelRight(ball);
void MoveOnePixelRight(Ball ball)
{ ball.X += 1; }
---------
Do you see how this makes sense?
I don't see why I have to add a foreach to Construct 2 when it appears that that's what the event logic is doing by default.
Why is this:
Event: Ball -> Is isSpiky
Any different than
Event: Ball -> Is isSpiky
Sub-Event: System -> For each Ball
?
Thanks for the help =)