Confusion on How Event Works ?

Discussion and feedback on Construct 2

Post » Fri Mar 23, 2012 9:27 pm

For your first problem you just need to destroy the initial shadow.
[code]Start of Layout:
--Shadow| destroy[/code]

The "A is overlapping B" condition filters object A and loops over all the collision pairs with B. An inverted "A is overlapping B" is just a filter for A.

So in event 2:
a. All the ShadowCasters not overlapping the player are selected.
b. Of the selected only the ShadowCasters with "haveShadow" are selected.
c. Now each Shadow.CasterID is compared with ShadowCaster.CasterID with this pattern
1st selected Shadow.CasterID is compared with the 1st selected ShadowCaster.CasterID,
2nd selected with 2nd selected... and so on.


You second example runs like this pseudo code:
[code]
For each clown overlapping player:
if clown havekid:
    select kids with id=clown.id
        destroy selected kids
[/code]
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Fri Mar 23, 2012 9:53 pm

Ah i see, that explain everything

So let me get it right, in case someone also have similar problem in the future:

- "Is overlapping" condition will run a "for each" loop for every filtered object.

- Invert of "Is overlapping" only pick the filtered object (without running "for each" on the filtered object)


Thanks R0J0hound, everything is cleared up for me now
B
34
S
13
G
8
Posts: 134
Reputation: 8,118

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests