How do I...find multiple overlaps

Get help using Construct 2

Post » Sat Oct 18, 2014 2:46 pm

Is there an way of checking if a sprite is overlapping a sprite, which is overlapping a different sprite? What I'm trying to do is pick the sprites that contain a specific variable and check if those sprites are overlapping each other and if they are, then check if they also overlapping this one other sprite. Right now I have:

System->pick all, is overlapping
Subevent->System->pick all, is overlapping

but it doesn't work all the time AND it keeps the original overlapped sprites picked and I don't want that.
B
10
S
1
Posts: 67
Reputation: 909

Post » Sat Oct 18, 2014 2:58 pm

Are these all instances of the same sprite?

I'm not sure why you are using the second pick all event for it completely overwrites the first picking..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Oct 18, 2014 3:11 pm

@LittleStain - I didn't explain things properly. Sorry about that.

There are 2 different objects involved.

The first overlap picks the "enemy" sprites that are overlapping a "laser" sprite. Then the second overlap picks the "enemy" sprites that are overlapping other "enemy" sprites that are overlapping the "laser" sprite.
B
10
S
1
Posts: 67
Reputation: 909

Post » Sat Oct 18, 2014 7:07 pm

As you wrote it in your first post:
enemy compare var
enemy is overlapping enemy
enemy is overlapping laser

And your last post:
enemy is overlapping laser
enemy is overlapping enemy
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Sat Oct 18, 2014 7:33 pm

@R0J0hound - That's exactly what I thought too. It sounds like such a logical and obvious solution, but I haven't been able to get it working. Over the last couple days, I've tried using every combination I can think of in the same manner you've suggested, using nested conditions, non-nested conditions and different combinations of loops. I thought maybe I was missing an easier solution, but if you're suggesting the same thing I've been thinking, then I must be on the right track, so I'll keep plugging away at it.
B
10
S
1
Posts: 67
Reputation: 909


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Google [Bot], tarek2 and 10 guests