Checking if objects were selected

0 favourites
  • 3 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • Trying to get c2 to react if specific objects of a certain type have been clicked or targeted. This is what I'm trying atm.

    Right now it isn't creating Sprite2, but when the create object command is placed above, in id = 1, it seems to work, making me think it's not progressing to the next id = 2, id = 3 conditions.

    Any other ways this can be done? In the above, I'm trying to create Sprite2 when Sprite id's 1, 2 and 3 have been clicked.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lets breakdown event 3 (and further) down.

    The 'Every tick' is not needed.

    The conditions read as follow ....

    'For each' runs trough every Sprite. Each run it picks 1 Sprite.

    So at any point in the iteration, the picklist now contains 1 Sprite.

    Event 4 starts picking from that (previous picked) picklist.

    It picks from that picklist all sprites with id = 1 and clicked = 1.

    The result is a new (refined) picklist. If that new picklist is empty, the conditions marks as untrue, and will not run its sub events, it will not run its actions.

    Lets assume that this new piclist is not empty at one point in the iteration.

    Or, lets assume that there is a Sprite with id = 1 AND clicked = 1.

    Now event 5 start picking from the (previous picked) picklist (in event 4).

    That previous picked list can only contain Sprites with id = 1. No others. Hence event 5 can never ever pick a Sprite with id =2 from a list that only contains Sprites with id = 1.

    Event 5 will never ever run, its picklist is always empty.

    Event 6 is a sub. Not only has it the same problem. It is also a sub under event 5. Since event 5 can never ever run, event 6 is never ever reached.

    Plz read this:

  • Ah thanks, I see!

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