How Hard Would an Inventory Like This Be?

0 favourites
  • 7 posts
From the Asset Store
Dynamic heavy and powerful hard rock tracks. 15 tracks, loops and more.
  • Im trying to wrap my head around arrays,It seems everyone is having issues with them these days.I wanted to know how difficult it would be to create a simple inventory like this one,I just want to be able to drag it from the bottom of the screen.The Game im showing is called Growtopia and its free on android if you want to check it out.I really need some help with an inventory without one my project is ruined.Thanks Everyone<img src="http://images.jayisgames.com/growtopia.jpg" border="0" />

  • You could always use two array lists:

    Inventory_Slot (How many objects of a given type is within this slot?)

    Inventory_Type (What kind of object does this slot hold at the moment?)

    When you add an object to the inventory in-game, use a loop to go through Inventory_Type from zero to 19 or whatever. Here's some pseudo-code:

    (where x is the current value being looped through)

    If Inventory_Type(x) = Object.Type OR Inventory_Type(x) = 0 (as in empty) --->

    Inventory_Slot(x) = Inventory_Slot(x) + 1

    Inventory_Type(x) = Object.Type (if the slot was empty we need to set it to the type of object added).

  • ErekT Thats basicly what i want is two simple lists,I just dont know how to make it happen the way you see in the picture.I want to have a real simple inventory and the way you are explaining im starting to get it somewhat,Most of the tutorials show how to make random arrays and generators,The inventory tutorials are way too advanced for a new person.If you could show me a better way to look at it i would be grateful,I know i can learn its all about having the right person explain it.Everyone learns Differently at different speeds but thanks man your words of wisdom will help me alot.

  • Don't know about the wisdom part but happy if I can be of help. Only had time to write up some pseudo-code real quick but I'll see if I can explain it a little better tomorrow.

  • I recently wrote a tutorial on how to create a simple inventory system. It looks like what you want is the same as what I wrote but if it's different I'd be glad to alter it for you.

    Edit: Here's the link

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Once you have a solid knowledge about arrays, something like this shouldn't be too hard.

  • sqiddster EncryptedCow ErekT Thank you guys for helping me it does mean alot,I apollogize for the late reply I stayed up all night working on my project.I will take a look around At your tut EncryptedCow,I know its just me and not you guys,I am a slow learner everyone of you explain really well its all about how i absorb this knowledge im being fed.I hope i can get this down i really do need a dragable type of inventory.alj@EncryptedCow If you can show me how to create a box that i can drag up and down the screen To hide/Unhide it like the pic that would be epic.But other than that im just going to try and study Cows tutorial.Thank you Guys This means alot

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