scope of local vars?

0 favourites
  • 2 posts
From the Asset Store
Ludo Local Multiplayer board game can be played by 2 to 4 players
  • Hi, I cant find any man pages for variable scope, does anyone know if there is one?

    1) What are the scope of local vars? E.g. if I create local vars at the top of a group, are they local to a group, the event sheet, or just the next event?

    2) Are global vars global to all event sheets?

    3) To try and simulate objects for better encapsulation and reuse, I want to create vars local to one event sheet. Is this possible, as you only seem to be able to create globals at this level?

    4) I see objects have a "global" setting. This seems odd, as objects seem to be global even if set to "no". E.g. if I copy an object from one layout to another, then modify the copied one, when I create an instance of the object on the first layout, it actually uses the settings from the second layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. from manual

    2. Yes

    3. Not really - see point 1.

    4. Global object means that this object is not destroyed after going to another layout. It will still have all parameters (like instance variable). Every "not global" object is destroyed and all parameters are reset after going to another layout.

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