How to use "For Each" condition?

Get help using Construct 2

Post » Tue Dec 11, 2012 11:02 pm

So, I've been browsing around this forum and I've come to read that Spread Values is not needed on C2,that it can be replaced with "For Each" condition.

I just want to know how to use "For Each" condition properly. I need some sort of instruction on how to start out.

I need to identify 10 weapons with numbers.
B
10
S
4
G
3
Posts: 46
Reputation: 3,036

Post » Wed Dec 12, 2012 12:43 am

Correct, spread values is not required, but a lot of the time for each is not required either. For example, if you have the action "set sprite variable to sprite.x" without any loops c2 will set each instance's variable to that instance's x value.

I wrote a tutorial a while ago about it here. I should update it a bit and put it in the c2 tutorials section...

Edit: updated version with new info: http://www.scirra.com/tutorials/418/for-each-tutorialArima2012-12-12 01:48:26
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Dec 12, 2012 1:03 am

Great tutorial Arima. Add me to the list of people who didn't know about picking before the foreach loop boolean2012-12-12 01:04:08
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Wed Dec 12, 2012 1:17 am

Thanks!

I will take a look at it!
B
10
S
4
G
3
Posts: 46
Reputation: 3,036

Post » Wed Dec 12, 2012 1:46 am

I updated it a bit with some more info and put it in the tutorials section: http://www.scirra.com/tutorials/418/for-each-tutorial
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests