Array-based inventory

  • 65 favourites

Index

Attached Files

The following files have been attached to this tutorial:

.png
.capx

array-based-inventory.capx

Download now 83.25 KB

Stats

7,078 visits, 25,425 views

Tools

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.

  • 0 Comments

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