Possible to compare 2 instances of the same object?

  • Sorry if this is a dumb question but is it possible to compare 2 instances of the same object?

    Say if I ask

    On Condition CARD overlapping CARD

    It finds the overlapping objects fine but how can I then compare the 2 cards? I want to see if they are on a particular layer and perform an action on them if they are.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, it is! (possible, not dumb)

    You want to use "System" expression "pick nth instance" inside a "on colision trigger".

    Something like this:

    In this case, hero colides with hero, but only the second object is destroyed. In your case, you'll just make another condition for each picked instance conditions and to things inside them... Hope it's not too confusing.

  • Another method is to create a family with Card sprite.

    Then you can refer to two instances of Card object in the same event:

    CardFamily overlapping Card:

    ...If Card is on layer 1

    ...If CardFamily on layer 1

  • Thanks so much for the suggestions. I'm going to try them both

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