I'm creating a type of "inventory" behavior that gets attached to a sprite. This would primarily be used in RPG-style games. I currently have things like "size of inventory" and "add item." It also has expressions that can be accessed like "Player.Inventory.NumberFilled." What "add item" does is ask the user for a slot, name, and sprite. Slot will be used as an index and the sprite will be used as an icon.
My questions are
- Is it possible to make an array (not the construct 2 array, but a javascript array/list) of these "items" that I'm creating?
- Is it possible to make an 'expression' that allows users to access each item with a line such as "Player.Inventory.Item(1)"?
- Is it possible to make sure that the object that users select for the icon is only a sprite object?
I can post my edittime/runtime with a .capx example if you want.