for each loop with objects fulfilling conditions

Get help using Construct 2

Post » Thu May 09, 2013 5:09 pm

hey everybody,
i just wanted to ask if it's possible to have the for each loop just used for the objects that fulfill the right conditions,
because i wanna have a variable by all of the objects checked that meet the conditions, and if all of these objects have the same value sth. happens.

i hope it is clear what i'm trying to ask ^^.

greets cannikon
B
3
Posts: 10
Reputation: 370

Post » Thu May 09, 2013 6:36 pm

Yes, just put the condition above the for-each loop.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Sat May 18, 2013 12:29 pm

sorry for the late answer but i wanted to thank you - that part now seems to work.
Even though there is another part that has something to do with it and that is causing problems now.

If all the switches that are connected are pressed (a local variable gets changed) and because of that a block appears, but when one of them isn't pressed any longer the block is still there.
just when all switches aren't pressed anymore the block dissappears again.
What i want though is that the block is there just as long as all switches are pressed.

here's the code example i hope it helps to understand what i want to say:
https://www.dropbox.com/s/t258mx2vzvrwb3f/code%20example.png

I thought it's better to ask it here at this topic because it is somewhat connected than creating another topic - i hope that is ok :) .

It would be veryy great if someone could help me
B
3
Posts: 10
Reputation: 370


Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble and 19 guests