overlapping 2 instances of the same object

Get help using Construct 2

Post » Mon Oct 01, 2012 1:43 pm

Hi everyone,

I'm a newbie, I completed the Top down shooter tutorial yesterday.

I have a game that starts by putting random planets around a map. I want to detect if any of these planets are overlapping another planet and destroy one of them if they are.

I tried
- On end of layout --> Mars is overlapping Mars --> Mars destroy
- On end of layout --> For each Mars --> Mars is overlapping Mars --> Mars destroy

But no luck. Can anyone help me?
Posts: 3
Reputation: 706

Post » Mon Oct 01, 2012 3:03 pm

Try this or


Here the game randomly pick the "chance" variable.
If 1 the Sprite 1 will be destroyed, if 2 the Sprite 2 will be destroyed.
Posts: 46
Reputation: 1,853

Post » Mon Oct 01, 2012 3:16 pm

I guess the issue is on "On end of layout".
This condition only happens when you are using the system action "go to layout" and so is some sort of "final actions" before getting to the next layout.
In your case, checking for colliding instances is pretty much useless since instances are destroyed from a layout to another.

You should provide a full capx of what you've been doing and explaining what exactly you're trying to do.

New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Posts: 7,319
Reputation: 87,487

Post » Tue Oct 02, 2012 9:10 am

Thanks guys - you were both spot on. The on end of layout was stopping this from working. The below worked:

Mars is overlapping Mars --> Destroy Mars

I'm not sure if it is destroying one of both, but I don't mind.

I was over-thinking this - I'm a programmer by trade. Construct 2 makes things easy - maybe too easy! :D
Posts: 3
Reputation: 706

Post » Sun Apr 14, 2013 10:33 am

Hi everyone, I want to know what is my mistake that I know uses the same event has some exception ..

The condition refers to the same sprit with several different frame

- One end of layout -> Mars is overlapping Mars -> Mars destroy (knowing that Mars is the same sprit)

These are not taken into account unless the collision is taken into account with "set polygon collision"

Finally sorry for the translation is the google ... And thank you
Posts: 37
Reputation: 1,049

Return to How do I....?

Who is online

Users browsing this forum: vegapomme27, Yahoo [Bot] and 9 guests