Data structure

Discussion and feedback on Construct 2

Post » Sat Jul 18, 2015 2:44 pm

Since there is no way to declare a Data Structure to group the variables in Construct 2, I use objects (text), declare them Global and add the instance variables that I need. What do you think about using this technique?

Image
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Sat Jul 18, 2015 3:53 pm

It shouldn't be a problem to do it that way, but you could use an Array object (and write down what each array position is used for) or use the Dictionary object which allows you to name the variables (add them by events on the first layout, then change their values/read them like normal variables.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Sun Jul 19, 2015 12:06 am

@phimaka
That's what I also do. I used to use JayJay suggestion, but now I only use that method when I want persistent dad.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Sun Jul 19, 2015 12:25 am

I do it exactly that way as well :).
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,215
Reputation: 43,852

Post » Sun Jul 19, 2015 12:52 am

There are some 3rd plugins for data structure, like this one.
B
108
S
26
G
268
Posts: 4,456
Reputation: 150,247

Post » Sun Jul 19, 2015 2:20 am

If it's a large data set, and performance is an issue, I like to use a four dimensional octree, with a recursive scalar index for the first couple of levels.

Otherwise, I just use global vars.

:)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Jul 19, 2015 2:28 am

TiAm wrote:If it's a large data set, and performance is an issue, I like to use a four dimensional octree, with a recursive scalar index for the first couple of levels.

Otherwise, I just use global vars.

:)


If you're not using lambda calculus for your boss FSM and a kalman filter to determine the player's ability then I'm not interested....

Probably! ;)
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,215
Reputation: 43,852

Post » Mon Jul 20, 2015 7:44 am

Colludium wrote:
TiAm wrote:If it's a large data set, and performance is an issue, I like to use a four dimensional octree, with a recursive scalar index for the first couple of levels.

Otherwise, I just use global vars.

:)


If you're not using lambda calculus for your boss FSM and a kalman filter to determine the player's ability then I'm not interested....

Probably! ;)


Yeah it almost goes without saying :)
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests