feature request: enumerated types

Discussion and feedback on Construct 2

Post » Sat Jan 05, 2013 1:26 pm

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.
B
12
S
3
G
4
Posts: 57
Reputation: 3,186

Post » Sat Jan 05, 2013 2:13 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Jan 05, 2013 3:03 pm

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
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Sat Jan 05, 2013 3:07 pm

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.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Jan 05, 2013 3:53 pm

Thanks Kyatrix for your response.

By non-trivial, I'm referring to more complex application with C2.
B
12
S
3
G
4
Posts: 57
Reputation: 3,186


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests