overlapping 2 instances of the same object

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this or

    <img src="http://img856.imageshack.us/img856/2333/ex1c.png" border="0" />

    this

    <img src="http://img254.imageshack.us/img254/4035/ex2k.png" border="0" />

    Here the game randomly pick the "chance" variable.

    If 1 the Sprite 1 will be destroyed, if 2 the Sprite 2 will be destroyed.

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

  • 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

  • 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 <img src="smileys/smiley2.gif" border="0" align="middle" />

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