Instance variable type: array

Discussion and feedback on Construct 2

Post » Wed Oct 10, 2012 10:16 am

What do you think?

It could be useful to store a set of values in the instance variable.
B
47
S
12
G
4
Posts: 546
Reputation: 7,616

Post » Sat Dec 30, 2017 10:35 am

This
B
6
S
2
G
1
Posts: 34
Reputation: 1,101

Post » Sat Dec 30, 2017 12:35 pm

all Instance variable is the same no matter the type of Object.... array, sprite, text etc all the same Instance variable
Image
B
54
S
16
G
2
Posts: 374
Reputation: 4,777

Post » Sat Dec 30, 2017 12:43 pm

This is supported in Containers.
Learning other engines, but C2 still rocks. Image Image Image Image
B
81
S
22
G
96
Posts: 2,467
Reputation: 58,351

Post » Sat Dec 30, 2017 1:59 pm

You can also use instance variable to store array's UID.
Add a couple of helper functions for setting/getting values in array by its UID and voilà - you have your array in instance variable.
B
19
S
9
G
158
Posts: 2,386
Reputation: 84,399

Post » Sat Dec 30, 2017 2:43 pm

Having an array as a primitive variable type instead of a separate object would be nice. It would make things more readable. As is picking and functions can make it look complicated and/or make things more complicated. Don’t get me wrong, picking is pretty nifty for many things but is an awkward replacement for some logic.
B
101
S
39
G
134
Posts: 5,591
Reputation: 85,520


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests