WHAT I WISH SOMEONE TOLD ME BEFORE I STARTED

Discussion and feedback on Construct 2

Post » Wed Jul 24, 2013 12:03 pm

1) Here's a .capx showing that it does in fact work without needing a resize action: https://dl.dropboxusercontent.com/u/15217362/arrayworks.capx
I think you might have been confused by the fact the array object defaults to 10x1x1, and since indices are zero-based, the element at 8,1,1 is outside the array. It works fine with 10x10x10 though, as the .capx proves.

2) Only if you use CocoonJS or the Intel XDK, and it's a documented limitation (e.g. see how to export to CocoonJS). If you use PhoneGap or a mobile browser it all works, but then you have other trade-offs (performance, distribution etc.)

3) Instance variables are static - you can only use the ones you added in the editor. The Dictionary object keys are dynamic, and can be changed at runtime, making it useful when you don't know in advance how many variables you'll need.

4) Well, that's to do with CocoonJS, and not Construct 2. Let them know about any issues you come across and hopefully they'll be able to fix them.Ashley2013-07-24 12:04:41
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Wed Jul 24, 2013 3:15 pm

Also a very useful practice is to ask how something works before complaining about it as you will find that in 90% of cases it's a lack of understanding of the feature as opposed to broken functionality. Just saying, due diligence and a bit of research will yield faster results than complaints. Going back to the subject of this post, if you would have asked, someone indeed would have told you.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Jul 24, 2013 4:24 pm

I use the dictionary object to store all the speech lines I need in my game. I could've used an array, but IMO the dictionary object is much easier to deal with.

Each key is the name of the object that the player is currently interacting with, followed by the number of lines they should say.

What I'm trying to say is: be creative.
B
124
S
43
G
41
Posts: 849
Reputation: 28,235

Post » Wed Jul 24, 2013 10:09 pm

[QUOTE=firebelly]Dictionaries and Arrays have different lookup times too. If you've taken any programming classes at school, they will make you learn Big O notation. It will explain why you would use them in different instances.[/QUOTE]
This is not true in JavaScript. JS arrays are a special case of an object and JS objects are (basically) dictionaries, which means JS arrays are also dictionaries. Typed arrays were added to address the performance issues of normal JS arrays.
B
17
S
6
G
6
Posts: 113
Reputation: 4,161

Post » Thu Jul 25, 2013 3:34 pm

[QUOTE=Ashley] 1) Here's a .capx showing that it does in fact work without needing a resize action: https://dl.dropboxusercontent.com/u/15217362/arrayworks.capx
I think you might have been confused by the fact the array object defaults to 10x1x1, and since indices are zero-based, the element at 8,1,1 is outside the array. It works fine with 10x10x10 though, as the .capx proves.
[/QUOTE]

You're right.
B
9
S
2
G
2
Posts: 47
Reputation: 1,822

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: bounty and 21 guests