general question: event-building

This forum is currently in read-only mode.
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • When should I choose for inserting all conditions in 1 event-block or inserting them as sub events?

    Example:

    A>

    + System: Is global variable 'Switch' Less than 1

    + Sprite1: Sprite1 overlaps Sprite2

    + Sprite3: Is on-screen

    -> do something

    B>

    + System: Is global variable 'Switch' Less than 1

       + Sprite1: Sprite1 overlaps Sprite2

          + Sprite3: Is on-screen

          -> do something

    I -think- option B is more useful for 2 reasons:

    • if you want to add something, you can add it to a sub event.
    • if a certain condition asks for cpu, Construct won't bother if the first condition is not met.

    Am I correct?

  • Yeah, I agree that option B is better. If you do plan on adding more to it though (I know you were just saying that as a hypothetical), I'd personally make my own group for it, have it disabled by default, and enable the group when the global variable "Switch" is less than one. If nothing else it's good for organization.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • - if a certain condition asks for cpu, Construct won't bother if the first condition is not met.

    First condition must be always met to run other conditions, so there is no real difference between those two examples, but B seems to be bit better for organizing. As you said, if you want to add something, you can add it to a subevent, and you can collapse the whole block, which is useful sometimes.

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