overlapping and detecting

For questions about using Classic.

Post » Thu Apr 08, 2010 5:28 am

My problem is that it seems that there's only a reaction to the first overlapping. Not to anything that comes after it (when overlapping of first still takes place).

I have 1 box (school), 1 sprite (child).
When child overlaps school: add 1 to variable.

If child stands in front of school building, it overlaps. Everything ok so far.
When a 2nd child comes as well in front of building, both children overlap. But it seems like it is ignoring the 2nd one.
Because overlapping is already "true"?

I wonder how I can get the next overlappings being detected by the "school".
Thanks in advance.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Thu Apr 08, 2010 5:48 am

If "child" is just a different instance of the same object, then no it wont detect it.
Try placing "child" into a family, or giving each new instance its own pv, and check with two conditions, child is overlapping, and child's pv is equal to new pv.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Apr 08, 2010 9:01 am

try the system condition 'for each object' thusly:

For each child
if child is overlapping school
-->set child pv to 1
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Apr 08, 2010 6:23 pm

[quote="Arcticus":3mc84xrz]try the system condition 'for each object' thusly:

For each child
if child is overlapping school
-->set child pv to 1[/quote:3mc84xrz]
Definitely the best way.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Thu Apr 08, 2010 8:52 pm

You don't need a for each if that instance is referenced in the same condition.
That instance is already in the S.O.L. It is picked by the condition, and since its pv can be changed to something different than all the other instance's pvs, it can be treated as a single object.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Apr 09, 2010 10:03 am

Sorry for the late reply. I already tried something, but I need more time.
Which I have today. To try to get it working.
What is S.O.L.?
pv = private variable?
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Fri Apr 09, 2010 10:08 am

[quote="rogerty":15t47jrf]What is S.O.L.?[/quote:15t47jrf]
S.O.L. stands for Selected Objects List I do believe, it basically a list of objects that fit your event conditions.
B
2
S
1
G
3
Posts: 118
Reputation: 1,336

Post » Fri Apr 09, 2010 4:34 pm

Thanks for all suggestions.

I am now using the following construction:

for each child
child: private variable is set to '1'
--> do something
B
16
S
5
G
7
Posts: 599
Reputation: 5,000


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests