How to I drag items from one inventory to another using arrays?
Develop games in your browser. Powerful, performant & highly capable.
MomaFugger You mean, edit the array on an editor? Or through events?
That depends on how you set up your inventory in the first place, there are many different ways to do an inventory.
If you have two instances inventory arrays, assuming you can already add and remove items, it would be as simple as removing from one and adding to the other. To pick the correct inventory to manipulate, you can utilize containers. This way your inventory array will be attached to a sprite or other object you can pick by mouse or touch.