What is difference between Dictionary and Array

Just started using Construct 2? Post your questions here

Post » Thu May 08, 2014 3:26 pm

I was just reading manual for dictionary and found has almost same expressions and the array so just curious what is the limitation of dictionary in-terms of use and how it is different from array?
Every Game is a Good Game it's just few people like and few does not! Keep coding people some day you will be a "NOTCH".
B
21
S
6
G
3
Posts: 85
Reputation: 4,607

Post » Thu May 08, 2014 5:42 pm

A dictionnary makes a key (string) correspond to a value (like a variable sort of, but more dynamic).
An Array makes a combination of 1,2 or 3 coordinate correspond to a value.

An Array is more powerful to apply/modify things for every single value for exemple, while a dictionnary is easier to use to store values and retrieve them, or save it quickly t the webstorage.

At the end, you could theorically use only 2D or 1D arrays to do the same job, but it is not as clear.

PS: The Json format of the array is not the same as the dictionnary one.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Fri May 09, 2014 12:17 pm

Thanks @Aphrodite that explains the way i can use both of them now on.
Every Game is a Good Game it's just few people like and few does not! Keep coding people some day you will be a "NOTCH".
B
21
S
6
G
3
Posts: 85
Reputation: 4,607


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests