Array-based inventory

  • 71 favourites


Attached Files

The following files have been attached to this tutorial:



Download now 83.25 KB


13,181 visits, 42,323 views



This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Manipulating with inventory

Lets begin with "On object clicked slot" event for mouse object:

Only action, that we can add for this even is the changing animation frame for "slot" sprite.

Now we need to detect if there is any object in this slot. To do this, we will use the two conditions:

In this condition we are checking if start slot is set and if this slot contain item.

If start slot is not yet set, we can set it. Along with this, we will set variables startitem and startnumber

Otherwise, if startslot has already been set, we need to set endslot:

Next, we have to set 2 conditions:

* if startitem ≠ enditem - we need to replace it and it's number

* if startitem = enditem - we need to summarize their number

What you get in the end:

Great, we finished the main part of our inventory system.

Now we need to automate all of our actions.


  • Order by
Want to leave a comment? Login or Register an account!