0 Favourites

How do I make "pick up and drop" inventory?

  • I have this inventory

    I can pick up items in the game that get attached to the cursor.

    When I drop the item on any of the slots, it disappears. I guess it doesn't get attached to that specific slot.

    This is the "code"

    How would I go about making such inventory which lets me pick up any item and drop it on the inventory. Without needing to repeat it for every single item in the game?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Hi Excyis

    Try this method.

    Set a group of sprites on top of your inventory box with different frames set as the items you will gather.

    Then use the drag and drop feature ...

    * "on item dropped" item = "sword" set inventory sprite to the corresponding image.

    *use a system function to check if the frame is greater then "0" to signal if the sprite box has already has been set to an item... if so, it moves to the next one and so on...

    Im guessing you are pining the items because the board is moving??

    put all your menu items on a layer of there own and set the layer parallax to "0,0" this will prevent the items from scrolling around on the screen.

    hope this helps

  • Oh I appreciate the help!

    LordShiva that thing is asking me to login for some reason D:

    TonyW I appreciate the help, but I think it's my fault for forgetting to mention some things about my game.

    The items in my game level up. So I'd rather not attach 200 variables to one sprite with all the item frames.

    Or rather, I'm trying to find a way to pick up items with individual stats. Since you'll be able to level different things on them. So using the sprite-based system might be a bit too much?

    Unless I'm unaware of a way to save specific item stats in different places.

    EDIT: Also the inventory gets moved off-screen to hide it so it wouldn't take up screen space.

  • If you have a game that will level up In 200 difrent ways its prob going to be to much for the c2 engine anyway... I don't think it was built to handle that kind of game, But I could be wrong.

    Good luck!

  • TonyW anything is possible in C2 if you plan it properly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,512
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,835
minhcuong's avatar
minhcuong
Unread hot topic
99 10,152
karshinkoff's avatar
karshinkoff