How do I This System Inventory [SOLVED]

1 favourites
From the Asset Store
Inventory Aid
$4.90 USD
Create grid-based game inventories and items easily.
  • Hi willmonteirofx,

    I've updated the capx again, adding in scrolling for the object layer and locking the hud:

    https://www.dropbox.com/s/vl30jbms1ucpf ... .capx?dl=0

    Instead of creating and destroying the picked object I just set it visible and invisible as needed.

    To keep the picked object on the mouse I set its position to mouse.X("picked"), mouse.Y("picked"), which means that it follows the mouse's position relative to the "picked" layer.

    I added now run the check to avoid spawning objects on the inventory against the inventoryFrame object rather than the inventory objects.

    Lastly, I swapped the names of the animations to their respective colour, rather than "one","two" etc, so that the picked text is less confusing.

    Notice that the both the "picked" and "inventory" layers have parallax 0,0.

  • Another idea would be the following : instead of moving the position of the object, each slot would have different animation which adapts when you collide an object. Each object has an ID. If you collide an object, this one is destroyed. On destroyed, you figure out how to pick the ID of this very object.

    Then you launch a for loop which looks for the first slot being empty. Once it's found, you set the animation you wish to the slot depending on the ID of the collided object.

    However, if you do so, all empty slot will be filled with te new object. To avoid this issue, you can add a test in the "for loop" to stop at the moment it reaches the first empty slot. For instance a boolean "isSearching" which is true until it finds an empty slot.

  • Hello Again!

    First of all thank you! The inventory system code was not so clear to me, but it worked perfectly, in time I know I'll understand. I thank you for your patience, I apologize for any inconvenience and I will be more than happy to help.

    I made a simple build of the prototype that already has ready, who wants to check how it was, feel free to test the link below. If there is a bug, feel free to report it too, I'll be happy to correct it.

    Link: https://imersastudios.itch.io/survive-it

    OBS: Apologies for my English, I know it is not very good. But with everything it gave you to understand xD

    Thank you again!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • willmonteirofx Glad to be able to help out - let me know if you need any further explanation. The prototype is looking nice btw

  • stop apologizing for everything and keep being nice bravo for your inventory !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)