Proper use of arrays? Weapons, Inventory, tileset, etc...

Get help using Construct 2

Post » Thu Feb 18, 2016 12:29 am

Do you guys typically use one array to store one type of item such as weapons? Or do you stack multiple types all into one array such as weapons, inventory, tileset, powerups, etc...?

If you do use one array, do you use a token to split between different types?

Weapon 0 1 2 3 4 5 | Inventory 0 1 2 3 4 5 6 7 8 9 | tileset 0 1 2 3 4 5 6 etc...
Football Dash (1m+): GooglePlay | AppStore

Zombie Bash: GooglePlay | AppStore

www.lumicreative.com
B
81
S
31
G
8
Posts: 505
Reputation: 10,709

Post » Thu Feb 18, 2016 1:22 am

It really is up to you. General tip is to not try to put too much information all in the same array, or it may get harder to manipulate/access the information you want. But other than that use whatever organization system makes sense to you.

A big consideration for me is usually that you can only use IndexOf on the X axis of any given array.
Mistakes were made.
B
60
S
30
G
134
Posts: 1,949
Reputation: 75,375


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests