feature request: enumerated types

0 favourites
  • 5 posts
  • Hi,

    My feature request is for enumerated types.

    Firstly, I'm really enjoying using Construct 2. It has a great design and is fun.

    For non-trivial programs, the event sheet gets pretty confusing. From what I've seen, the standard approach for implementing a workflow is to disable/enable groups of events.

    My preference (to disabling/enabling groups) is currently to create a number which represents a state in the event sheet. I personally find this a better way to understand/write non-trivial code.

    Therefore it would be great to have enumerated types, so I can label the states in the event sheet and make it more readable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Global variables can be turned into constants.

    Use them as labels.

    Example capx

    Also, enabling/disabling groups is not the only way to do stuff.

    As you can see in the example a simple variable check allows you to make events for a certain "state".

    You also now have the "Function" plugin to call/execute specific bits of code from an action. It was recently added, so most of the examples in the forums don't (yet) implement it much.

    I'm not sure what you mean exactly by "non-trivial" program though.

  • Kyatric, that's a good tip ! But isn't adding a lot of global variable a bad thing? Or is that just a myth? I am not a programmer, so I don't really know better. :D

  • Adding new variables every tick is a bad thing. Adding a few dozen, even hundred static variables is not a bad thing. Well, except for organizational purposes, maybe.

  • Thanks Kyatrix for your response.

    By non-trivial, I'm referring to more complex application with C2.

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