How do I Pick All Other Instances

  • I'm trying to figure out how to pick all the instances NOT met in the condition:

    If Mouse is overlapping MenuItem
    Set MenuItem frame 1
    
    Pick All Other Instances
    

    Set MenuItem frame 0[/code:1ny6tj49]

    Something like this. My usual non-coding way of doing it would be to set an instance variable for each individual one and do:

    If MenuItem Var = 1
    

    Set Frame to 1

    >>>>>If Menu Item Var 2

    >>>>>If Menu Item Var 3

    >>>>>If Menu Item Var 4

    >>>>>If Menu Item Var 5

    >>>>>If Menu Item Var 6

    >>>>>If Menu Item Var 7

    >>>>>If Menu Item Var 8

    >>>>>>>>>>Set Frame to 0[/code:1ny6tj49]

    But this gets incredibly messy. Am I over-complicating this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Simply change all before changing the desired object.

    For instance:

    Main Event

    On mouse overlapping menuitem

    action: tmpvariable = menuitem.UID

    sub event 1

    pick all menuitem

    action: menuitem set frame 0

    sub event 2

    pick menuitem by evaluate menuitem.UID = tmpvariable

    action: menuitem set frame 1

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