How do I simulate ELSE on clicked object?

0 favourites
  • 4 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hello,

    I have one big sprite as a background and several small sprites on top of background.

    I want to know if I clicked small sprite (add score) or clicked anywhere else (decrease score). Currently when I click on small sprite then I get add score and decrease score together because both sprites are under mouse cursor.

    Something like:

    IF small sprite is clicked:

    add score

    ELSE if big sprite is clicked:

    ...i want to go there...

    ENDIF

    Any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Root event ___On click (< the trigger, triggers cant stand an else, so now a sub event)

    ________Sub event___Cursor is over object (small one)

    ________________________Action for the little one

    ________Else

    ________Cursor is over object (big one)

    ________________________Action for the big one

  • rotacak

    99Instances2Go suggestion should work fine, another way would be to add a second condition to the big sprite click that says "mouse not over small spite"

    so:

    IF small sprite is clicked: add score

    IF big sprite is clicked AND mouse not over small sprite: decrease score

    (You do a "not over" condition by adding another condition that says Mouse Over object, and then right-click that and invert it)

  • Thank you, it works

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