How do I create / manage my inventory- equip items etc.

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • in a nut-shell here is what I am trying to do drawn out-

    I have this game I am working on- I am not a programmer as you can tell if you look at my capx. I was able to hack my way through a lot of the game so far - here is where I am at:

    https://dl.dropboxusercontent.com/u/14800164/2TM/index.html

    So the game is simple- you can answer math questions to play through, and there is a merchant that sells 2 random items- sometimes it is a clothing item that you can then equip in your inventory. You can have one hat shirt pants and a weapon equipped at a time.

    Where I am running into trouble- The bg square for the items is the same image with multiple frames. Ive been playing with it trying to make it so if you select one, the rest deselect. Also- I need to put one with the equipped text (frames 2 and 3) - then I need a way to save data so you can navigate the different frames and come back and still see which is equipped.

    Ill also need a way to easily distinguish which items are equipped so I can use character maps in spriter to make the player reflect the changes.

    Ive looked into using arrays - but it kind of goes over my head. Any advice, or even a quick write up of how you would go about doing something like this would be very helpful.

    here is my sad attempt at trying to build this inventory:

    https://dl.dropboxusercontent.com/u/14800164/inventory/index.html

    and here is the capx if you want to see what i have or are willing to help me out

    https://dl.dropboxusercontent.com/u/148 ... px/capx.7z

  • You will totaly need arrays for that!

    Also the inventory you want to have is not the easiest with the different pages and all that stuff.

    You could use a 3D Array or multiply 2D Arrays for that.

    (or maybe put all pages in one 2D array but thats kinda chaotic)

    Also a logic for sorting items and equiping.

    However i think there are some pretty good inventory templates in the scirra shop.

    If you cant make your own just use on of those.

    If you like to try by yourself start with "binding" every slot in your inventory to an arrayslot.

    So you will be able to load the content of the slot depending on the array.

    So the itemslot ist just a graphical representation of the arrayslot.

    I tried the game. I like it but i got a bug where i gave the right answer and he just dident attack.

    Also is it possible to lose in this game? Is there a time limit?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hey dsminor thanks for the reply! And the suggestions. I will look into it further- I just dont get how to use an array to do what I want it to do- I get that I can store a bunch of values but I just dont know what it would look like...

    Ill take a look at the shop and see if I can find something similar to what I want to do in there.

    As for the bug where you got the right answer and didnt attack- I just didnt get that far yet. That last goblin will be a "bridge troll" and he will have a different encounter 'code' so that you dont fight him. Ill get there! Trying to get all the core stuff done before building out the levels. I think that part should go pretty smoothly once I can figure this inventory thing out...

    when you say ill need logic- what does that mean? Maybe I need to do some more research

  • Oh an array is just a list, grid or cube of values nothing special about it.

    For a inventory an 2D array is just a grid with an x and an y coordinate, like a sheet of quad paper.

    And every quad would be an inventory slot to store something in.

    Oh ok so i just completed the game

    Still i dont get any damage will you get hit if the answer is wrong or you are to slow?

    Oh with logic i just mean a system to do it, english isent my native language, maybe i have a different understanding of the term.

    In philosophy class we used the term "logic" as a system of arguments which follow a certain order to archiv something, i guess i stuck with this definition.

    However i just meant you need to figure out a system for that.

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