check that ALL instances of a sprite are overlapping another

  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)