How "for each" works ?

Get help using Construct 2

Post » Wed Mar 20, 2013 5:11 pm

I have the following example and I have a question:
Why does the condition is not meet ?
This is a simple example that is not working in my game.In some situations the "for each" condition works as I expected...but not in the above example
capx



The result:
Cipriux2013-03-20 17:12:59
B
64
S
16
G
20
Posts: 471
Reputation: 16,131

Post » Wed Mar 20, 2013 5:25 pm



It's picking.
You don't need a for each there, and the most important is to be sure to select the correct object in the condition.

Example that goes further.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed Mar 20, 2013 5:58 pm

@Kyatric I know I don't need "for each" in this example, I just didn't understood how is working. I thought the loop works like this:
- select first RED square
- check if GREEN square overlapps the selected RED square
- select second RED square...and so on

but I guess the correct behaviour is like this:
- select first RED square
- check if RED square overlapps the selected GREEN square
- select second RED square...and so on
Is that true?
In that case...i need to take a cold shower and reprogram my little brain synapses.
ThanksCipriux2013-03-20 18:01:01
B
64
S
16
G
20
Posts: 471
Reputation: 16,131


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, Skebab, spcsmrf and 20 guests