check that ALL instances of a sprite are overlapping another

Get help using Construct 2

Post » Fri Apr 29, 2016 10:02 pm

Hiya,

Say I have multiple say "ball" objects and I have a "Goal" object, the balls are physics'd sprites that you must get all of them into the goal, OR a certain minimum count of them. The goal just being a square sprite that acts as a goal 'zone'.

How Can I keep a count of how many of the ball objects are overlapping the goal? Would it work if I had multiple goal objects in a level and it kept a total across all the goals.

Also say if a ball fell out of the goal then it would subtract 1 from the goal'd balls count.

I've managed to google and search up every question I've had before now but I'm stuck at this point :(

Thank you muchly <3
B
11
S
3
Posts: 4
Reputation: 850

Post » Fri Apr 29, 2016 10:21 pm

Have a "ball is overlapping goal" condition along with "compare ball.pickedcount to ball.count". If the number picked by the overlapping condition equals the total number then they're all overlapping.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Fri Apr 29, 2016 10:48 pm

ramones wrote:Have a "ball is overlapping goal" condition along with "compare ball.pickedcount to ball.count". If the number picked by the overlapping condition equals the total number then they're all overlapping.


Genius! I wasn't aware object.pickedcount existed :) Thanks for this insight!
B
11
S
3
Posts: 4
Reputation: 850


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu, Xh3maa and 9 guests